-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the C++ part #83
Comments
Looks like we need to add more info for beginners, but how does it related ... hmmm -_- Also, as I understood, my two latest screencasts (this, or this) that combines a several methods at once (for both host sides) completely confuses some people. Some people think that this is only about exporting from .NET (this dllexport), others combines unnecessary code, and so on. Well, detailed chapters with description seems does not help. Olaf, your 6 line code in details:
GetProcAddress(
_In_ HMODULE hModule,
_In_ LPCSTR lpProcName // <<< You have "Netz" exported function, thus you need this and not "_Netz"
);
extern "C" __declspec(dllexport) double cNetz(double p) This was for .NET to use unmanaged library, if you remember, like: using(var l = new ConariL("unmanaged_c_library.dll"))
{
Double val = l.DLR.cNetz<Double>(1234); // __declspec(dllexport) double cNetz(double p)
// Win API including +LoadLibrary/Ex and lot of other related things
#include <windows.h>
// if you want to work with TCHAR like from my screencasts:
// otherwise you can via wchar_t or char, etc.
#include <tchar.h>
|
Remove
There is some difference from msvc compiler, but even for msvc if 64bit environment, no, and for 32bit env with __cdecl also no. Here I meant C compiler or C++ with C-mangling. Some other compilers does this also differently: MSVC, GCC, CLang, ...
Why you don't what to use Fortran if you already know this perfectly?! About Unhandled exception (KernelBase.dll): More like the export works well, and you just have problems in your VB function :) Check this out. Try to debug in mixed code. Probably will help to isolate problem. |
Hi Denis, I would do it in Fortran, but I don't know how. But I will try. Thank you for your help. Olaf |
Hi Denis, excuse me once again very, very much, Would you help me again? Olaf ps: the code is the same like before |
Try to set [mixed] debugging type in properties for C++ project. For how
does it work see in screencast part-2 when stepping into managed code
from unmanaged. Then try again to debug at runtime.
…On 31.08.2018 14:24, haller9816 wrote:
Hi Denis,
excuse me once again very, very much,
But I can not step into the vb. I made a project (C++), added the
other (VB ) and did a reference in the C++-console to the VB-classlibrary.
And while debugging the same error like before occurs. Looks like the
interface dosn't work or my mixed language work not correct.
Would you help me again?
Olaf
ps: the code is the same like before
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#83 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/ADGJ_aNnXNmYkN4EFu0t5GfEK65Ce1S3ks5uWR0DgaJpZM4WSaMM>.
|
Hi Denis, hi all,
it's me again. I have the VB.NET code with DLLEXPORT with no ERROR.
Now I try the C++ calling as a console application (later it should be a dll) and have problems:
errors are: GetProcAddress, HMODULE, lib and LoadLibrary are not found or declared (looks if I have something to load)
and I think the declaration:
extern "C" _declspec(dllexport) double cNetz(double p);
is not complete.
I have no experience with C or C++, I do programm in FORTRAN. That was enough for technical calculations.
Would you help me again?
Olaf
The text was updated successfully, but these errors were encountered: