Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[v8i VBA] Error when calling C++ function

$
0
0

Hi

I have tried to make a super simple C++ function and call it from VBA, but I keep getting Runtime error '49'. Bad Dll Calling Convention.

Any help is appreciated.

The C++ function:

extern "C" __declspec(dllexport) int testFunction(char* font)
{
	mdlDialog_openAlert(font);

	return 0;
}

And the VBA Macro:

Declare Function testFunction Lib "mylib.dll" (ByVal stringP As String) As Long

Sub Macro1()
    testFunction ("Test")
End Sub

Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>