|
coco243 wrote: Maybe this operator: It is a simple overload of the assignment operator in C++. But is has very little to do with your question. The method you need to use is at the beginning:
virtual Connection * connect(const sql::SQLString& hostName, const sql::SQLString& userName, const sql::SQLString& password) = 0;
|
|
|
|
|
Yes, but I don't know where to find the definition of this method.
I don't find the code behind it.
|
|
|
|
|
That is the definition of the method. You just need to code it with all the parameters filled in as necessary.
|
|
|
|
|
I don't see where I am misunderstand the things but it appears to me as a declaration of a method.
For example if we have a class defined like that:
class point{
public:
int x,y;
void set (int val_x, int val_y); };
void point::set( int val_x, int val_y)
x = val_x;
y = val_y;
}
void main()
{
point p1;
p1.set(10,2);
}
In the set method I have the parameters val_x and val_y, and I see in the definition of the set method the processes that implies val_x, and val_y,
I see that val_x is attributed to x and so over, but in the connect method I don't see where hostName, userName and password are used.
That it what I want to understand.
Thank you,
|
|
|
|
|
coco243 wrote: in the connect method I don't see where hostName, userName and password are used. Why do you need to? All you really need to understand is that the C++ library will use those details to create an actual connection to the MySQL driver, and from there to the actual database server.
|
|
|
|
|
I had figured that if I know how this function is defined, I can extract more information about the conection, status of conection and other things that I am not aware, in addition I wanted to have a better overview on the subject.
modified 10-Jan-23 10:25am.
|
|
|
|
|
All such information would normally be found in the documentation. And after searching the MySQL pages I think you need to look at https://dev.mysql.com/doc/c-api/8.0/en/[^]. it is titled "C APIO", but I assume it works just as well with the C++ driver.
|
|
|
|
|
Normaly this information should be in the installation folders of the C++ connector, in the headers files, and some of it, it is, but I just don' t know where to find definition of those methods, any way I supose that I will succed finally, but it would have been intresting to know how this method were coded. Or maybe those would be an waste of time or to complicate for my knowledge level.
|
|
|
|
|
I gave you a link to the API in my previous message, you need to go and study it.
|
|
|
|
|
|
|
|
|
Hi,
I built a function library (dll) in MS-Visual Studio 2022 using C/C++, to be accessed directly from Excel cells via VBA code.
When I call the dll in the 32-bit version of Microsoft 365 Excel, no error occurs. But when I compile the dll for x64 and run it from the 64-bit version, an access violation occurs in the function arguments.
Summarizing the project in a single function:
---------------------------------------------------------------
.cpp file:
extern "C"
{
__declspec(dllexport) double __stdcall fA(INT64&);
}
double __stdcall fA(double& a)
{
return a;
}
-------------------------------------------------------------
VBA da planilha Excel:
Declare PtrSafe Function fA _
Lib "C:\dll64\dll64.dll" (ByRef a As Double) As Double
-------------------------------------------------------------
|
|
|
|
|
Why did you declared it as
double __stdcall fA(INT64&); not as
double __stdcall fA(double&);
|
|
|
|
|
I'm trying to get some code to run to work around another issue, and for the life of me, I cannot make the VS2008 linker happy.
This is for a smart device, Windows Embedded Compact 7, but I think the target is only a symptom. I've tried this against 3 different SDKs for VS2008 as well as EVC++ (going way back) and two different SDKs - all have the same issue.
I need the application to run OLE. So, I created a very simple dialog app - think default code base, C++. It compiles and links. I then add one call: "OleInitialize(0);" and I get this:
Quote: 1>Linking...
1>OleTest.obj : error LNK2019: unresolved external symbol OleInitialize referenced in function "public: virtual int __cdecl COleTestApp::InitInstance(void)" (?InitInstance@COleTestApp@@UAAHXZ)
You can say I need to add an input to the linker line for ole32.lib, but it still fails. Oddly, VS2008 shows that I've inherited these from the solution. Of course the desktop links fine.
Any random or "oh crap, yeah, I had that problem" ideas? It's almost as if the ole32.lib doesn't have OleInitialize. I could believe that for one SDK but not 5.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
As rough guess, the linker is not able to find the ole32 library for the embedded platform target (the reason I really don't know).
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Well that's the obvious thing, but for the life of me I don't know why. I have other code that links with a few non-default libraries, and these are found fine. I searched my SDKs, and all of them have the library in question.
Very weird.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
|
Give that man a cigar!
It had to be something stupid like that - I didn't pick up on that because if I hit :: - OleInitialize is actually in the popup. I guess it's in a header file but not in the binary.
Thank you
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Charlie,
charlieg wrote: I guess it's in a header file but not in the binary.
Thank you
You are welcome.
|
|
|
|
|
I am working on c++ desktop application , i have to allow one time access for each employee per a day,
the question is how to interact with access control and open the door through it
(the access control has its dadecated software to open the door)
a looked for the API from its proper website but they do not offer it
now i have just the access control driver.
|
|
|
|
|
The question is impossible to answer since we have no idea how the access control software works. You need to contact the manufacturers of the door for help.
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
asked and answered in QA, I think.
Keep Calm and Carry On
|
|
|
|