-
Posts
353 -
Joined
-
Last visited
-
Days Won
35
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by dadreamer
-
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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? -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
There are literally zero chances that someone would hack you through callback DLL, that will be loaded into LabVIEW address space. 😃 -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
https://stackoverflow.com/questions/10599940/module-unsafe-for-safeseh-image-c For this project - yes. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
typedef BOOL(__stdcall* Type_SetStandardDataCallBack)(LONG lRealHandle, void(CALLBACK *fStdDataCallBack) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer, DWORD dwBufSize, DWORD dwUser), DWORD dwUser); -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
Instead of void (CALLBACK *fStdDataCallBack) try to add this: -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
Which line is this error generated at? -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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? -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
-
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
I assume, fStdDataCallBack cbStdDataCallBack might be replaced with void(CALLBACK *fStdDataCallBack) (LONG lRealHandle, DWORD dwDataType, BYTE *pBuffer,DWORD dwBufSize,DWORD dwUser) -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
You've dealt with them before. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
@alvise Yeah, just try to compile Rolf's code, it's already done and intended for your case exactly. Wait no more. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
Share your VI or a snippet. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
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. -
Using the DLL files of an application compiled with C# with labview
dadreamer replied to alvise's topic in LabVIEW General
You forgot brown error wire. 🙂