Jump to content

dadreamer

Members
  • Posts

    353
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by dadreamer

  1. These four functions should be there, they are "service" functions for LabVIEW core. But your functions did not get exported at all for some reason.
  2. All you need is to disable option "Image has Safe Exception Handlers" in Project properties -> Configuration Properties -> Linker -> Advanced tab. Why are you trying to adjust Debug config, when you're on Release one?
  3. There are literally zero chances that someone would hack you through callback DLL, that will be loaded into LabVIEW address space. 😃
  4. https://stackoverflow.com/questions/10599940/module-unsafe-for-safeseh-image-c For this project - yes.
  5. typedef BOOL(__stdcall* Type_SetStandardDataCallBack)(LONG lRealHandle, void(CALLBACK *fStdDataCallBack) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, DWORD dwUser), DWORD dwUser);
  6. In your code the callback function doesn't have parameters. Likely this is not reason for the error you shown, but it's better to specify the parameters explicitly.
  7. Instead of void (CALLBACK *fStdDataCallBack) try to add this:
  8. Looks to me like some headers conflict... Try to #include "pch.h" as the first header file (before any other headers). Also you may remove all that C:\Program Files\... stuff from the #include directives and leave header names only, as you already specified cintools path in the project settings. If that doesn't help, disable precompiled headers to see, what happens. Besides, those %28 and %29 characters on your screenshots look odd to me, because I had not noticed before that Visual Studio escapes some symbols in path names. Do they get added automatically?
  9. In the project settings you need to add: - CINTOOLS path to Additional Include Directories field (Configuration Properties -> C/C++ -> General tab) and Additional Library Directories field (Configuration Properties -> Linker tab); - labview.lib (or labviewv.lib) to Additional Dependencies field on the Linker -> Input tab.
  10. So you got that DLL compiled? Also to note, switch to Release configuration as you very likely are not going to debug that DLL by the MSVC debugger. Doing that you should have proper linking to the MSVC Runtime instead of the debug libraries.
  11. I assume, fStdDataCallBack cbStdDataCallBack might be replaced with void(CALLBACK *fStdDataCallBack) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize,DWORD dwUser)
  12. @alvise Yeah, just try to compile Rolf's code, it's already done and intended for your case exactly. Wait no more.
  13. Callback is still needed. I said that PostLVUserEvent call may be omitted. If you don't know C even at very basic level and can't compile DLLs, I'm afraid I can't help here. There are many example on making C/C++ DLLs on the net. My advice is to learn them carefully and only after that go to callback things.
  14. Since BitBlt is used, your PictureBox object should be visible and on screen completely, because when it's not, then black areas are captured. PrintWindow on the other side should deal with (partially) hidden windows better, but I have no idea why it doesn't work in your case.
  15. Glad something finally worked for you 🙂 What about pressing that BitBlt button? And you don't need to cast the handle to U64 - just change ToInt32 method to ToInt64 and pass the wires to the VI.
  16. There exists an easier callback variation, that doesn't involve calling PostLVUserEvent. I have used it few times in the projects with VLC video streaming from several cameras. It's an asynchronous method too, but it works for sure. The main point is that on the diagram we call DSNewPtr and pass new pointer to the library. When the callback is called, it just writes data by that pointer. In LabVIEW we just read the data by the pointer constantly and process it, if necessary. It's good for common video translation or for simple image processing, when not each video frame is required. Still needs the DLL to be written/compiled though.
  17. I meant this part: It just makes no sense to capture Empty.vi window and a little sense to capture the whole main VI window, when a concrete .NET window region is wanted. Ok, when drawn onto Empty.vi panel, the whole window must be captured.
  18. I assumed, you would feed the PictureBox handle into Get Image By HWND.vi instead of feeding a panel window handle. No need to use FP.NativeWindow here. Just typecast the handle refnum to U64 and wire to that VI.
  19. I'm not a big fan of Get Image method, because it has a whole load of disadvantages: runs in UI thread only; requires a front panel to be open (and visible to reflect the changes); redraws an image after the control modified it (i.e., scaling, cropping etc.), so if you have the original image of 1024*1280 pixels and it's rendered into the control of 10x10 pixels, you'll get those 10x10 pixels instead; draws control's label/caption additionally (sometimes it's wanted, sometimes not); doesn't work for some third party ActiveX/.NET controls (maybe, because they all use different rendering techniques); sometimes lags / doesn't capture the image. When it goes to capturing the window contents by its HWND, I prefer this self-written VI (based on WinAPI calls). Get Image By HWND.rar And I'm using it that way. Maybe in alvise's case it will suit as well - the chances are slim, but real. 🙂 Note also: the CLFN's in Get Image By HWND.vi are set to UI thread now, but it's safe to set them to any thread, if desired.
  20. Then it should be that HCNetSDK.dll draws on the window canvas directly, not dealing with any related objects. I don't see, how you could easily intercept the data. If you are serious about HikVision image processing in LabVIEW, you'll have to return to the callback attempts.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.