Link to home
Create AccountLog in
Programming

Programming

--

Questions

--

Followers

Top Experts

Avatar of LEONEL ROCHA
LEONEL ROCHA🇺🇾

Run-time error '49' Bad DLL calling convention
I'm  programming in Visual Basic 6.0 sp6. I've received a DLL called CRYPTOKI.DLL and some examples written in C or C++ (i don't know because I've not expertise in C). I know that the DLL have a function called C_CLOSESESSION that returns a long value and needs a long value session number as parameter: rv&=C_CLOSESESSION(handle&). The function is declared as: PUBLIC DECLARE FUNCTION C_CLOSESESSION LIB "cryptoki.dll" (byval handle as long) as long

When I call that function I receive run-time error 49.
¿Is possible that this DLL only works in C?
¿Exist another way to invoke that function or I'm doing something wrong?
¿Is possible convert this DLL to be used in VB (I read something about STDCALL)?
I have a .LIB file also.

Thks in advance
Leonel

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of List244List244

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of LEONEL ROCHALEONEL ROCHA🇺🇾

ASKER

The fact is that the dll already exist and i've not the source code.

SOLUTION
Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Programming

Programming

--

Questions

--

Followers

Top Experts

Programming includes both the specifics of the language you’re using, like Visual Basic, .NET, Java and others, but also the best practices in user experience and interfaces and the management of projects, version control and development. Other programming topics are related to web and cloud development and system and hardware programming.