|
i use vc6.0 to develop a ActiveX
the os is win2000
in my computer it's ok
but in XP occur error
why?
study everyday
|
|
|
|
|
wokankan wrote: but in XP occur error
, which ?
wokankan wrote: why?
No way to tell you, without knowing error .
|
|
|
|
|
i know the reason
but i can't resolve the problem.
when i use this sentence :
mainWnd = this->GetMainWnd()->m_hWnd;
i use tool->register control
then occur error
study everyday
|
|
|
|
|
i am trying to get address of dll function but not able to do that,any idea how to solve it.....
it always return null....
SetQuote = (Set_Quote_DB)GetProcAddress(hInstance,"setQuoteToDB");
if(SetQuote != NULL)
{
MessageBox("set quote is not null");
}
else
{
MessageBox("set quote is null");
}
|
|
|
|
|
Are you sure hInstance is valid ?
|
|
|
|
|
yes i think ,see my code....
HINSTANCE hInstance ;
hInstance = AfxLoadLibrary("C:\\ActiveXdll\\WartzODLCOM.dll");
if(hInstance != NULL)
{
MessageBox("load dll");
}
else
{
MessageBox("enable to load dll");
}
SetQuote = (Set_Quote_DB)GetProcAddress(hInstance,"setQuoteToDB");
if(SetQuote != NULL)
{
MessageBox("set quote is not null");
}
else
{
MessageBox("set quote is null");
}
|
|
|
|
|
Did you use of GetLastError for error information?
|
|
|
|
|
|
use of this function for see error and also check setQuoteToDB for exports statement on dll
|
|
|
|
|
do you have any link,i have never used this function before
|
|
|
|
|
You dont need any link best explain is on MSDN
|
|
|
|
|
|
No i am still stuck with same problem...do you have any clear idea how to call com dll function....i think my problem is that only....pls if you can help me....
|
|
|
|
|
Check name function and parameters(input/output) on dll that are same with when you call this file on your application
|
|
|
|
|
see i have chkge the code still i am not able to locate my function.....i have tried all my best...pls help me...still it return null...and for function call setquotetodb is....unhandled exeption in apiocx
access violation.
code here
HRESULT hresult;
CLSID clsid;
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("WartzODLCOM.DBAccess"),&clsid);
_DBAccess *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(IDispatch ),(LPVOID *) &t);
if(FAILED(hresult))
{
AfxMessageBox("Creation Failed");
return;
}
else
{
MessageBox("success");
}
SessID=SessionId;
CurrentRequestId=RequestId;
marketno.Format("%d",MarketNo);
bid_d.Format("%c",BidDirection);
ask_d.Format("%c",AskDirection);
marketstate.Format("%d",MarketState);
m_MainEdit= SessionId + "\t" + RequestId +"\t"+ marketno ;
m_MainEdit= Market + Bid + bid_d + Ask +ask_d High ;
m_MainEdit=m_MainEdit + Low + marketstate + Timestamp ;
UpdateData(FALSE);
iLineCount=m_EditCtrl.GetLineCount();
m_EditCtrl.LineScroll(iLineCount);
if(hresult != NULL)
{
MessageBox("not null");
USES_CONVERSION;
BSTR bsTimeStamp = A2BSTR(Timestamp);
BSTR bsMarket = A2BSTR(Market);
BSTR bsBid = A2BSTR(Bid);
BSTR bsAsk = A2BSTR(Ask);
t->setQuoteToDB(&bsTimeStamp,&MarketNo,&bsMarket,&bsAsk,&bsBid,&MarketState);
SysFreeString(bsTimeStamp);
SysFreeString(bsMarket);
SysFreeString(bsBid);
SysFreeString(bsAsk);
}
else
{
MessageBox("null");
}
CoUninitialize();
return;
}
|
|
|
|
|
Hello Fiends...
I have create an separate DLL to Show/Display Unicode Text on Dialog.
But the problem is that I want to store that text pointer in non-unicode work space. How to do this...
I explain general floew of my project...
In main work-space, when user want to draw text Object, Unicode supported dll is called and text Object displayed on screen and control returns back to main work-space. Now I want to perform some string operation on that string pointer( i used LPSTR) and want to store it in ClistCtrl...Its not working properly..
plz help me How to support multi-language ...
Thanks in advance
|
|
|
|
|
Do you mean to say that all the unicode stuff has to be handled by a dll and your interface to the user is separate? If you would like to display unicode characters in your interface program, then that too has to support unicode.
rahul.shendurnikar wrote: plz help me How to support multi-language ...
define _UNICODE in your precompiled header file (stdafx.h)
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
I am not sure whether i understood ur question. Any way u can convert unciode string to mulitibyte using the following function
wcstombs or
WideCharToMultiByte
nave
|
|
|
|
|
thanks brahmma and Nveen
hey my problem is that The unicode string is pointed by LPSTR pointer which is used in Non-unicode workspace and have to perform some string operation on it. But the unicode encoding is like '\0' after each character for English.
eg TEXT will store as 'T' '\0' 'E' '\0' 'X' '\0' 'T' in LPSTR.
and i cant add LPSTR in ClistCtrl Bcoz it treat it as only onecharacter T and '\0' as null terminated string.
thanks
Born To Code
|
|
|
|
|
I am not understanding you. Do you want to display a unicode string in a list control? Please be precise to the point.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
first of all thanks to look into my problem...
The Flow is-->
let lpTextPtr is of type LPSTR;
I write -->
lpTextPtr[0]='T';
lpTextPtr[1]='\0';
lpTextPtr[2]='e';
lpTextPtr[3]='\0';
lpTextPtr[4]='x';
lpTextPtr[5]='\0';
lpTextPtr[6]='t';
lpTextPtr[7]='\0';
lpTextPtr[8]='\0';
lpTextPtr[9]='\0';
and send lpTextPtr to Unicode Supported DLL.
Where lpTextPtr is assigned to EditBox of that unicode Dialog.(works fine)
In the Dialog(of DLL) I select Language the and write a any Text in editBox. The editBox's text is assigned to lpTextPtr.(works fine).
and control leaves DLL and backk to mai workspace.
Now Here I want to store lpTExtPtr(say in CListCtrl)...
it cant persist its value in nonUnicode invironment.
how to convert Unicode to normal string and then normal string back to Unicode is my problem...
Born To Code
|
|
|
|
|
rahul.shendurnikar wrote: how to convert Unicode to normal string and then normal string back to Unicode is my problem...
Have a look at the following functions in msdn.
WideCharToMultiByte()
MultiByteToWideChar()
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hello
I've been using the API GetCurrentDirectory() to retrieve the current working directory of my application. The code snippet is below:
char szPath[100];
GetCurrentDirectory(sizeof(szPath),szPath);
The above function works fine if the path of the current directory is 100 chars. But what if the path of the current directory is more that that ? My app would crash rite ?
So is there any way to make the size of szPath dynamic, such that from wherever our app gets runned (watever be the path length) the app shouldnt crash.
Thanx
|
|
|
|
|
try with this one.
char szPath[MAX_PATH];
GetCurrentDirectory(sizeof(szPath),szPath);
Have A Nice Day!
Murali.M
|
|
|
|
|
in the NTFS format, the maximum length of a file name or directory name can be up to 255 characters. So u can use char szPath[256];
or u can use
char szPath[MAX_PATH];// MAX_PATH is declared in windef.h
nave
|
|
|
|