Click here to Skip to main content
15,878,231 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: auto closing messagebox Pin
Rajesh R Subramanian19-Apr-09 20:46
professionalRajesh R Subramanian19-Apr-09 20:46 
AnswerRe: auto closing messagebox Pin
MANISH RASTOGI19-Apr-09 22:54
MANISH RASTOGI19-Apr-09 22:54 
QuestionUsing 宝 in _RecordsetPtr, without setting Chinese IME in my windows Pin
leesense19-Apr-09 16:54
leesense19-Apr-09 16:54 
Questionchar+char issues Pin
gamefreak229119-Apr-09 14:39
gamefreak229119-Apr-09 14:39 
AnswerRe: char+char issues Pin
aks.19-Apr-09 18:59
aks.19-Apr-09 18:59 
GeneralRe: char+char issues Pin
gamefreak229119-Apr-09 19:32
gamefreak229119-Apr-09 19:32 
Questionactivex dll problem [solved] Pin
maxMESA19-Apr-09 0:48
maxMESA19-Apr-09 0:48 
AnswerRe: activex dll problem Pin
Stuart Dootson19-Apr-09 1:47
professionalStuart Dootson19-Apr-09 1:47 
maxMESA wrote:
My question is how can i load this dll in my activex. I am using LoadLibrary(x.dll) and it searches for dll in windows/system32 folder.


Construct the full path to the DLL and pass that to LoadLibrary.

You can get the ActiveX's path using GetModuleFileName[^], either by storing the ActiveX DLL's HINSTANCE in it's DllMain or (and I think this is better, as there's no global varible involved) by using GetModuleHandle[^] or GetModuleHandleEx[^] to get the ActiveX DLL's HMODULE. In fact, if you put the function below in your ActiveX DLL (it has to be in that DLL), you'll get the ActiveX DLL's path - the function asks for the module containing itself.

std::string GetThisModulesFileName()
{
   HMODULE hMod;
   char path[MAX_PATH];
   GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<lpcstr>(&GetThisModulesFileName), &hMod);
   GetModuleFileNameA(hMod, path, MAX_PATH);
   return std::string(path);
}</lpcstr>


You might want to add some error checking for production code Sniff | :^)

Once you've got the ActiveX DLL's path, it's simple to extract the directory with PathRemoveFileSpec[^] and then add on the DLL's name with PathCombine[^].

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

AnswerRe: activex dll problem Pin
maxMESA19-Apr-09 7:14
maxMESA19-Apr-09 7:14 
Questionpoint reference VS value Pin
sharion18-Apr-09 21:18
sharion18-Apr-09 21:18 
AnswerRe: point reference VS value Pin
Stuart Dootson18-Apr-09 22:53
professionalStuart Dootson18-Apr-09 22:53 
GeneralRe: point reference VS value Pin
sharion19-Apr-09 1:35
sharion19-Apr-09 1:35 
GeneralRe: point reference VS value Pin
Luc Pattyn19-Apr-09 1:49
sitebuilderLuc Pattyn19-Apr-09 1:49 
GeneralRe: point reference VS value Pin
Stuart Dootson19-Apr-09 1:52
professionalStuart Dootson19-Apr-09 1:52 
GeneralRe: point reference VS value Pin
sharion19-Apr-09 3:21
sharion19-Apr-09 3:21 
GeneralRe: point reference VS value Pin
Stuart Dootson19-Apr-09 3:52
professionalStuart Dootson19-Apr-09 3:52 
GeneralRe: point reference VS value Pin
Luc Pattyn19-Apr-09 4:05
sitebuilderLuc Pattyn19-Apr-09 4:05 
GeneralRe: point reference VS value Pin
Stuart Dootson19-Apr-09 4:24
professionalStuart Dootson19-Apr-09 4:24 
GeneralRe: point reference VS value Pin
Luc Pattyn19-Apr-09 4:37
sitebuilderLuc Pattyn19-Apr-09 4:37 
GeneralRe: point reference VS value Pin
Stuart Dootson19-Apr-09 4:56
professionalStuart Dootson19-Apr-09 4:56 
GeneralRe: point reference VS value Pin
Luc Pattyn19-Apr-09 5:00
sitebuilderLuc Pattyn19-Apr-09 5:00 
GeneralRe: point reference VS value Pin
Stuart Dootson19-Apr-09 5:04
professionalStuart Dootson19-Apr-09 5:04 
GeneralRe: point reference VS value Pin
sharion19-Apr-09 5:25
sharion19-Apr-09 5:25 
GeneralRe: point reference VS value Pin
Stuart Dootson19-Apr-09 7:15
professionalStuart Dootson19-Apr-09 7:15 
GeneralRe: point reference VS value Pin
sharion20-Apr-09 18:30
sharion20-Apr-09 18:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.