Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / DLL-Function (C++) without definded Number of Parameters

Author
Message
DaDrivel
18
Years of Service
User Offline
Joined: 15th Aug 2006
Location:
Posted: 6th Nov 2006 14:29
Hi Community!
I wanted to write a DLL-Function, that is similar to the C-Function "sprintf". But I got the problem, that I wasn't able to write a DLL-Function with an undefined number of Parameters.
I know how to write the code in the DLL(C++), but I don't know how to write the string-table(if I want to write a Plug-In) or how to call that function in DBP.
Perhaps you can halp me, thanks

DaDrivel
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 14th Nov 2006 09:14
That's the trouble. Best to have a class that is accessed from straight C functions. I don't know of a way to export classes to DBPro, except to wrap them in C. Seems weird, but it works fine. You can have your overloaded function in C++, but wrap that call in a regular C function to access from DBPro.

It would probably be easier to simply abandon the requirement for variable number of parameters, imo.

The topic of using the string table for export of dll functions is covered in the help topic "Technical Documents/Third Party Commands".
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Nov 2006 14:07
It can be done - it's done within the DBProSystemDebug.dll with the CALL DLL functions and commands. Basically, using an X in the argument string allows a free-type value.

DaDrivel
18
Years of Service
User Offline
Joined: 15th Aug 2006
Location:
Posted: 24th Nov 2006 14:32
@jinazai:
The problem is, I can't abandon a variable number of parameters, when I want to to write a function, that is similar to printf. I could overload my functions and define one number of parameters, but that's not really, what I wanted.

@IanM:
Does it also allow no parameter?
Or just a free-type value.

Thanks so far for your help.

DaDrivel

Login to post a reply

Server time is: 2024-11-22 11:51:01
Your offset time is: 2024-11-22 11:51:01