|
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
|
|
|
|
|
Do you mean to say that a file name / directory name (starting frm its root) cannot be more than 256 chars ? What if its more than 256 chars ?
Thanx
|
|
|
|
|
vipin_nvk wrote: if its more than 256 chars ?
No, it cant?
|
|
|
|
|
no no, i mean length of a single file or folder cannot be more tha 255 charachters. u can have path of upto 32768 unicode characters.
I ur case length can exceed MAX_PATH.. my mistake
nave
|
|
|
|
|
Naveen R wrote: u can have path of upto 32768 unicode characters.
No , You can't. It includes full path. It can be limited up to 256 chars.
Naveen R wrote: I ur case length can exceed MAX_PATH
Naveen R wrote: .. my mistake
No, you aren't.
|
|
|
|
|
prasad_som wrote: No, you aren't.
consider the following case.
He created a folder having name of 200 chatacters. Inside that folder he create another folder with 200 chatacters. then he put the exe in that folder and executed. The MAX_PATH wont work na?
nave
|
|
|
|
|
Naveen R wrote: Inside that folder he create another folder with 200 chatacters
He can't. He can create folder upto 55 characters then.(i'm assuming its on root folder). In other words
c:\[200 chars]\[then this name can be upto 55 chars]\[still there are some chars left to reach 256, then file/folder can be created otherwise not] .
So in any case, full path name will not exceed _MAX_PATH .
|
|
|
|
|
i checked.. u r right
nave
|
|
|
|
|
I can create a Maximum path upto 247 chars only including Root Directory.
C:\suniljampasuniljampasuniljampasuniljampasuniljampasuniljampa\suniljampasuniljampasuniljampasuniljampasuniljampasuniljampa\suniljampasuniljampasuniljampa\suniljampasuniljampasuniljampa\suniljampasuniljampasuniljampa\suniljampasuniljampasuniljamp
But MAX_PATH is 256, and you mentioned that excluding C:\, one can create 255 chars. But I cannot create more than 247 char folder including C:\.
|
|
|
|