|
There is no compilation error no crash but nothing works .I have included one header file which contain dllimport statement.
------------------Myheader.h-----------------------
<br />
<br />
extern "C" _declspec(dllimport) char * Calc(int *,int *);<br />
extern "C" _declspec(dllimport) void Sub(int *,int * );<br />
-------------------------------------------
What i am really trying to do is calling one function from a dll which inturns call another function from another dll .can anyone tell me how to do this ?now what really happens here is that calc () is getting executed but sub() is not .
any help appreciated.
Thanks in advance.
|
|
|
|
|
cristi_alonso wrote: I have included one header file which contain dllimport statement.
In general, the way to do it is to include the same heared file with the trick I gave you in my previous answer. The advantage is that you don't have to maintain two files: if you have to make a modification, it will be done in one single place.
cristi_alonso wrote: now what really happens here is that calc () is getting executed but sub() is not
How do you verify that ? Are you sure that the version of your dll in the folder of your exe is out of date and the Sub function does nothing. Recompiling your dll is not enough, you also have to copy it to the exe folder, otherwise your exe will still use the previous version. It may sound stupid, but it is a common mistake when you debug.
|
|
|
|
|
I tried by deleting the file and agian recompile but it is not working .can anyone provide me some code snippets to access any function form dll.
How can i do this with LoadLibrary and getProcessaddress method ?it will be great if anyone can provide link for this.
any help appreciated.
thanks in advance.
|
|
|
|
|
Hi,
I am displaying HTML using OnNavigateComplete2() method, inside this function I am using NavigateText()
function to dispaly HTML but at particuler point, program giving exception for some HTML text when I run the application using vista.
The function is
void CDisplayBody::NavigateText(CString pszText)
{
try
{
if (!m_bHasDocument)
{
Navigate(_T("about:blank"));
return;
}
if (GetBusy())
Stop();
IDispatch * pDisp = GetHtmlDocument();
if (!pDisp)
return;
IHTMLDocument2* pDoc;
if (SUCCEEDED(pDisp->QueryInterface( IID_IHTMLDocument2, (void**)&pDoc )))
{
CComBSTR bstrURL;
CComVariant varDummy;
pDoc->open(bstrURL, varDummy, varDummy, varDummy, NULL);
SAFEARRAY *pSA;
SAFEARRAYBOUND saBound = {1, 0};
pSA = SafeArrayCreate(VT_VARIANT, 1, &saBound);
VARIANT *pVar;
CComBSTR bstrHTML = pszText;
varDummy = bstrHTML;
SafeArrayAccessData(pSA, (void**)&pVar);
pVar[0] = varDummy;
SafeArrayUnaccessData(pSA);
pDoc->write(pSA);
pDoc->close();
SafeArrayUnaccessData(pSA);
SafeArrayDestroy(pSA);
pVar=NULL;
pDoc->Release();
pDoc=NULL;
}
pDisp->Release();
pDisp=NULL;
}
catch (...)
{
}
}
when control comes out the scope of if it opens a file named "atlcomcli.h" and point a statement
"HRESULT Clear() { return ::VariantClear(this); }" and program crash.
How can I resolved it?
|
|
|
|
|
I guess this problem is due to ComVariat.Try to get some tutorial how to use them.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hi Friends
How to call one external .EXE file using MFC ?give any urls r something....
Thanks 'N' Advance
Nisha.S
|
|
|
|
|
use ShellExecute() or CreateProcess() functions.
|
|
|
|
|
You can use following functions
1. ShellExecute /ShellExecuteEx
2. CreateProcess
Regards,
Sandip.
|
|
|
|
|
use ShellExecute() method.
ShellExecute(handle, _T("open"), <fully_qualified_path_to_folder>, NULL, NULL, SW_SHOWNORMAL);
Mukesh Kumar
Software Engineer
|
|
|
|
|
::ShellExecuteEx(LPSHELLEXECUTEINFO lpExecInfo);
may be this can help you. YOu can launch any exe file using this function and filling the structure.
|
|
|
|
|
Use ShellExecute
-@SuDhIrKuMaR@-
|
|
|
|
|
Please read the previous answers before posting. This has already been said three times before
|
|
|
|
|
Do you know toxxct?
|
|
|
|
|
Soon he will come and his wrath will be terrible
|
|
|
|
|
Cedric Moonen wrote: Soon he will come and his wrath will be terrible
Yeah Im agree with you.
|
|
|
|
|
toxxct ? who's that ?
|
|
|
|
|
Your dark side maybe ?
|
|
|
|
|
ah, it was meant darkcct ? ^^
|
|
|
|
|
|
http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx
http://www.developerfusion.co.uk/show/9/2/
http://msdn.microsoft.com/en-us/library/bb762154.aspx
Best suitable :
SHELLEXECUTEINFO info;
memset(&info, 0, sizeof(SHELLEXECUTEINFO));
info.cbSize = sizeof(SHELLEXECUTEINFO);
info.fMask = SEE_MASK_FLAG_NO_UI;
info.lpVerb = _T ("open");
info.lpFile = sLink; // File Path...
info.nShow = SW_SHOW;
return :hellExecuteEx( &info );
Welcome in Advance...
Jagdish Bhimbha
|
|
|
|
|
You might read here first.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi! I'm Rathakrishnan. I've developed an application using VC++ 2008 Express Edition. I compiles fine. When I ran this application, it showed an error, "This application has failed to start because MSVCR90D.dll not found". Similarly ,MSVCP90D.dll not found. When I search the system for this dll, I found the dll in the following paths.
(i) "C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456"
(ii)C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC90.DebugCRT
Also I found a dll version with a nosxs_ prefix(i.e nosxs_msvcr90d.dll). Which version of the dll should I use? nosxs or ordinary? I've installed Service Pack3 for Windows. But it alos didn't work. How to resolve this problem?
|
|
|
|
|
Please ensure the above mentioned paths are mentioned in 'Path' environment variable.
akt
|
|
|
|
|
Value of PATH in the System variables is, "%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem".
modified on Tuesday, June 10, 2008 12:32 AM
|
|
|
|
|
please add the above mentioned paths also.
akt
|
|
|
|