|
Since only one parameter (the last one) can be a retval parameter, you can only return one item - but this item can be a array of objects (SAFEARRAY packaged in a VARIANT , perhaps?).
You can try a retval of a VARIANT parameter and build a SAFEARRAY into it. Check the MSDN example for SafeArrayCreateEx(...) , it provides an example of creating a SAFEARRAY and putting it into a VARIANT .
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Sorry i cant unterstand this mapping of an safearray to variant, i rather dont know where to put that code? Must be in the idl file, because the interface have to know it!?
But i really dont know how to do that!
If someone has an example on how to implement a safe array as a retval of a COM function defined in an idl file!
Or another solution for the problem from the first thread!
greetz
Balu
|
|
|
|
|
My IDL is rusty, so this may not be exactly right, but I think the parameter would be something like:
[out,retval] SAFEARRAY(BSTR)** str_array
SAFEARRAY is a IDispatch-compatible parameter so there's no need to put it in a VARIANT .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I am hosting an MSHTML browser control in my app via CHtmlView. Is it possible to get notified as it tries to download each page element (e.g. an image) and force it to instead get it from somewhere else?
It'd be nice if I could also intercept and replace the entire page itself. Right now, I'm doing this in OnBeforeNavigate2() by setting the cancel flag, calling Stop() and then calling Navigate() for the new URL
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hello,
one of our Networkers asked me, if MFC uses
the Internet Explorer SSL certificates?
I didn't found informations in the internet.
He told me that Java uses own certificates,
so he wanted to know.
Hope someone can help me
Thanx
Dannydust
P.S.: Greetings from Germany
|
|
|
|
|
I found the Answer!
The SOAP toolkit uses the same certificates as the IE.
Greetings
Dannydust
|
|
|
|
|
I want to communicate with USB port without using RS232 converter in VC/VB.
Please Help
Rujuta
|
|
|
|
|
And to which device is it connected ? There should be a driver supplied with the device and you have to open this driver (with CreateFile) and then send commands using DeviceIOControl. The commands are supplier specific.
|
|
|
|
|
Hi,
I am working on Threading and am using CSingleLock to control access to shared resource. I have a doubt..must the CCritical section be member of the class or can it be local to the function?
1)
void foo()
{
CCriticalSection CritSection;
CSingleLock singleLock(&CritSection);
}
void foo1()
{
CCriticalSection CritSection;
CSingleLock singleLock(&CritSection);
}
2)
CCriticalSection m_CritSection;
void foo()
{
CSingleLock singleLock(&m_CritSection);
}void foo1()
{
CSingleLock singleLock(&m_CritSection);
}
Are both the baove approaches correct?
Please give me your inputs on this?
Thanks
|
|
|
|
|
AFAIK, example 2 is correct.
|
|
|
|
|
The CCriticalSection object must be a member of the class. Both locks must operate on the same object.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello
I am developing a dialog based application in which during some processing by application, a dialog box with message "Please wait... while processing." is displayed. For this perpose, I initiate a thread in which processing is done. I used DoModal() to display above dialog in that thread. I want to close it and return to parent window on end of processing. Please tell me how can i do that.
Thank you.
We Believe in Excellence
-- modified at 2:18 Thursday 16th February, 2006
|
|
|
|
|
You know that DoModal is a blocking call ? The function will return only when the dialog is closed. So, if your processing is just afte that, there will be a problem because the processing will be started only when you close your dialog. Take a look at modeless dialogs, I think this will solve your problem. (Then when the processing is finish, you can destroy the modeless dialog).
|
|
|
|
|
Calling DoModal() from your worker thread probably won't work, and even if you do set up a message queue for the thread, showing the dialog on that thread defeats the purpose of having a worker thread.
The main thread should show the dialog. In OnInitDialog() , start the worker thread and pass it the dialog's HWND . When the thread's work is done, post a message (such as WM_APP ) to the dialog so it knows the thread's done and it can close itself.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Probably the simplest way would be to run the routine that does your processing within the dialog box that says "Please wait......" After completion, the routine can close the dialog box (CDialog::OnOK () would do the job). This would also enable you to give the dialog a button that may interrupt the processing (set a flag on pressing that button that you check in your proces's loop). Also, it would be easy to add a progress bar in your dialog box.
If you need a lot of variables from your parent dialog, you can simply pass a pointer to the parent to you modal dialog.
Success.
William
-- modified at 11:41 Thursday 16th February, 2006
|
|
|
|
|
You can try to begin another thread to show the message dialog. in this thread , call DoModal can implement it.
when you begin some job in the main thread, you begin the thread to show the message dialog. after you complete job in the main thread, you can kill the thread for show message dialog.
|
|
|
|
|
Hi,After I created my DLL using ATL. I call it by:
#import and CoCreateInstance
but when I use this dll in another windows (that hasn't Visual Studio)
I gives me Send Don't Send error message.
Please help me,
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Maybe you should register the dll you created on another windows before you use it.
the command line is: regsvr32 (your dll name)
|
|
|
|
|
Hi,
I want to develop a keyboard application which assists user to type in a language other than english. User will type using English keyboard. My app will transliterates it to Unicode equivalent of other languages.
But this app should work across windows. I mean user can type in to note pad also using my app.
Any body give me hint how to do that ?
Thanks in advance
|
|
|
|
|
|
RajeshHegde8xp wrote: ny body give me hint how to do that ?
try keyboard hook
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thanks for reply,
Both anwsers are great. But for my problem keyboard hook seems to be good option.
But i checked examples of Keyboard hooks there we can listen key presses and record it. But i want to listen keypresses and modify key presses as user types.
Thanks again.
Regards
--Rajesh Hegde
|
|
|
|
|
I want to capture the drag or drop operation in the shell(explorer.exe).
What should I do?
|
|
|
|
|
Does anyone know how to get file size, if i work with files using ifstream class?
|
|
|
|
|
<br />
#include <iostream><br />
#include <fstream><br />
using namespace std;<br />
<br />
void main() {<br />
ifstream in("c:/boot.ini");<br />
in.seekg(0, ios::end);
streampos ps = in.tellg();
cout << "File size: " << ps << endl;
in.close();
}<br />
|
|
|
|