Member Avatar for nova37

i added libmysql.dll as resource to my project

 ID_LIBMYSQL RT_RCDATA "LIBMYSQL.DLL"

Image view :: http://s18.postimage.org/bcpf2s9jt/Untitled.png

now when i try to find it using findresource function , i get error code : 1812 mean resource not found

HMODULE hMod = GetModuleHandle(_T("libmysql.dll"));
HRSRC hRes = FindResource (NULL, "ID_LIBMYSQL", RT_RCDATA); // RT_RCDATA application raw data
// get last error code
cout<<"\n error code: "<<GetLastError();

I gather your using TCHARs and most likely compiling as _UNICODE, so try:

HRSRC hRes = FindResource (NULL, TEXT("ID_LIBMYSQL"), TEXT("RT_RCDATA") );
Member Avatar for nova37

now getting error code 2 // file not found ..... but as you can see the image view in my above post , libmysql.dll as attacked to exe

Member Avatar for nova37

thanks done i have to pass current exe path find resource function as first parameter

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.