|
_bstr_t keeps an internal ASCII copy of the BSTR which is populated on demand. This copy is the internal data buffer that the char* extractor returns a pointer to. Therefore the answer I gave is what the OP needs and wants.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Stuart Dootson wrote: _bstr_t keeps an internal ASCII copy of the BSTR which is populated on demand
Interesting. Is it really ASCII, or whatever the system code page is ("ANSI")?
|
|
|
|
|
No idea - didn't look quite that far into the source (comutil.h in your VS distribution, if you want to look).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
hi friend,
i have vb dll..in the vb dll one fuction f1;
Public Function f1(SendString As String) As String - this function taking as argument and return string...
how i will call in vc++;
CoInitialize(NULL);
hresult=CLSIDFromProgID(OLESTR("prjdll.clsdll"), &clsid);
_clsdll *t;
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_clsdll),(LPVOID *) &t);
CString str= "000001";
t->f1(str); // this is crasing....
please help any body.
|
|
|
|
|
You need to pass this as a BSTR (or possibly a BSTR encapsulated in a VARIANT). Open the VB DLL in the OLE/COM Object Viewer (use the File->View TypeLib... command) to see what parameter type the VB DLL is expecting to see for this call.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
You cannot pass a CString 's instance, you've to pass a BSTR .
Anyway, the
Member 3653751 wrote: t->f1(str);
call seems wrong (what is _clsdll type?)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi
I m developin an application with treeview on left side and formview on right side(Splitterwnd).
Whenevr a user cliks an itme in treeview a form window will appear on right side.
My Problem is that OnInitialUpdate Fn is not working in the formview...
Due to this i face a problem of using the list control in the application..
But in different project of normal SDi, the Initial Update Funtion works fine..
Can Any One Suggest me a Solution?
|
|
|
|
|
Hello Sirs
Is it possible to convert FFMEPG on Visual Studio ?
thanks
raju
Failure is Success If we learn from it!!
|
|
|
|
|
No it is not possible. See here[^] and here[^].
-Saurabh
|
|
|
|
|
|
RASDIALPARAMS lpRasDialParams;<br />
ZeroMemory(&lpRasDialParams,sizeof(lpRasDialParams));<br />
wcscpy(lpRasDialParams.szEntryName, TEXT("我的连接"));<br />
lpRasDialParams.dwSize = sizeof(lpRasDialParams);<br />
BOOL lpBool = TRUE;<br />
DWORD dwReturn = 0;<br />
<br />
dwReturn = ::RasGetEntryDialParams(NULL, &lpRasDialParams, &lpBool);
dwRetrun value is 1168 ? what is this?
|
|
|
|
|
Try looking at the documentation for the function[^]. That points you at either the RAS specific errors or winerror.h. In winerror.h, you'll find this:
#define ERROR_NOT_FOUND 1168L
which I suspect means your entry name is unknown.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
yes, i seee it.
but entry name is right, the name is same of ras connect name
|
|
|
|
|
|
I'm using a long long variable with swprintf, however swprintf is unable to understand long long and returning zero.
wchar_t[20];
long long var = 500000;
swprintf(t, L"%i", var);
MessageBox(NULL, t, L"Output", NULL);
tried %i and %d
any advice for work fix solution or a work around! i would be very thankful.
|
|
|
|
|
try %lld, that's what most C runtimes use, I don't see it in the MS doco, but it might just work...
modified on Sunday, April 25, 2010 2:59 PM
|
|
|
|
|
|
Not portable, "I64" formats a _int64, while "ll" formats a long long, which is AT LEAST 64 bits long. Haven't yet met a platform where they differ though
|
|
|
|
|
OP said nothing about "portable"
|
|
|
|
|
See the MSDN reference here[^] for details of format specifiers. Your format string uses "%i " which is for normal integer.
It's time for a new signature.
|
|
|
|
|
How do you format numbers with commas?
10
100
1,000
10,000
100,000
1,000,000
10,000,000
100,000,000
1,000,000,000
I found the context for doing that somewhere before, but I'm unable to find anywhere!
|
|
|
|
|
|
Hi, I'm a student and now I'm working on a project in computer vision field. I need to detect the changes between two images (captured at different times, at the same position ), and the problems are noises and illumination variations in these images. I've read many paper with complex algorithms to solve these problems, but it's very difficult to implement them in programming language (mine is C++). Could you suggest me how to solve these problem, or point me to an open source program which does this task ?
Thanks and best regards !
|
|
|
|
|
Here is a more logic thinking solution than actual guidance.
I'm sure you know char table[x][y], I believe you can use it with the Bitmap data type. I don't know the relevant declaration for it. You create a table for the first image and a second table containing the second image. You can then select which to use as reference and then calculate based on pixel [1][1] for the second picture based on the difference for the reference picture. Hope that helped!
If you can share those papers, I have interest to dip my hands on something similar.
|
|
|
|
|