|
Thanks For the reply.
dharani wrote: f(pExplorer)
pExplorer->get_Subjet(&subject); // exception at this statement
I am Very Sorry. I wrote the wrong statement in my question, the statement I intended to write is as follows...
pMailItem->get_Subjet(&subject);
But....
pExplorer->GetCaption();
this statment is giving the proper output..
Means there is no problem with pExplorer.
Then what is the the problem with _MailItem even sometimes get_SenderName is giving the output.
Please give me the solution.
Thanks Again for ur Immidiate Reply and Helpful suggestion...
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
You will have to initialize the CComQIPtr Application pointer with the object from Outlook. What I can assume from your code is that you are not initializing this pointer with the outlook object. How does your application know that it has to get an instance for outlook, so this fails and then when you do something to get the subject it causes an exception to be thrown.
you can also try debugging your application.
Try something like this. I haven't checked the code but it might help you.
CComQIPtr<Outlook::_Application> spApp;
HRESULT hr = spApp.CoCreateInstance(__uuidof(Application));
if (FAILED(hr)){
MessageBox("Unable to instantiate Outlook.","Outlook Error",MB_OK);
return 0;
}
-- modified at 0:30 Friday 10th November, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hey friend,
I want to transfer query result from sql to a ComboBox.I derive a class from base class CComboBox.But,when using it in project,breaks when InitDialog at
...
myCombo->AddString(Sql.pData[i]);
...
anybody have solution?
Thank.
mad:
Lee
|
|
|
|
|
hello
What do you do to Sql.pData[i] before callinng AddString() ?
Did you check if there are values in Sql.pData ?
Put a break point there ?
Did you verify if you have called CMyComboxClass *myCombo = new CMyComboxClass() ?
redindian
|
|
|
|
|
How do you create combobox before use?
|
|
|
|
|
I want to register ATL COM DllServer in mFC Application, how can i do it.
I adds the sipport of ATL, and one NEw ATL COM object to my application, now i want to register this object in registry through My application, For example if we create ATL COM wizard application ,ther is a function DllRegisterServer() ....
Plz help me out
|
|
|
|
|
Hi
Use shellexecute(regsvr32,path of dll);
redindian
|
|
|
|
|
Hi look at this example
ShellExecute( NULL, _T("open"), _T("regsvr32"), _T("/s \"") + szFolder + _T("yourATLCOM.dll\""),NULL,SW_HIDE);
redindian
|
|
|
|
|
Thnaks for reply.
What is the fourth argument, szFolder what it is?
|
|
|
|
|
Its path of the folder where your dll is present .
redindian
|
|
|
|
|
how to get the path from which drive our ATL COM application is running,
if i used GetCommandString() it gives default path c:\Windows\explorer.exe
but what i want is, if i am running the application from D drive the path comes as d:\ like FOR MFC Application it works but for ATL COM applications doesn't work...
plz help me out
|
|
|
|
|
hi friend,
you already got an answer for your question, but i am having a suggestion. if you use shell functions , you need to add shell library and its platform dependent. So my idea is you to go for DllRegServer() function which is inside your COM object. Load this function, it will do your job. This method will give you the exact error report. If you use shell , you can’t. And one more thing , This method is not useful for all kind of COM dll’s suppose if you are building a Shell Extension dll, you need to use Shell API o register that dll.
thanks
|
|
|
|
|
use CWebBrowser2::Navigate() to display a web page.
how to know if the page is displayed properly or not?
e.g.
if the page is invalid or user doesn't connect to the internet, the page can not be displayed - in the case, I want to display a local page instead.
|
|
|
|
|
Have a look at the definition of this function and try to work around with the return types if it fails .
redindian
|
|
|
|
|
Check for Navigate_complete or Navigate2_complete and Document_complete.
Hope this will help to get when page downloaded completly.
To get knowledge of error you should check MSDN for IWebBrowser2 control.
First deserve then desire. Let be deserved first.
|
|
|
|
|
who can tell me what's the CALLBACK and give me some simple code. thanks
msn:Flashcutreg@hotmail.com
|
|
|
|
|
A callback is a function that's passed to a method by a function pointer, and which then 'calls back' to provide a hook into some aspect of a functions progress, such as providing details for a progress report.
The MSDN has lots of examples, in functions that use them.
|
|
|
|
|
A Callback is a function of which the Name and Address have been registered in a special list in the excecutable file, so that other processes can access it by name It is essentially a 'Widely Advertised Function'
LateNightsInNewry
|
|
|
|
|
|
Does anyone know how to find out the bounds of esp in a running program in a System way. At the moment I use something like the following for the Upper Bound:-
///////////////////////////////
static DWORD TOP_ESP=0;
void ChckStack(void){
int CharArr[4092];
__asm mov TOP_ESP,esp;
ChckStack();
}
int GetStackTop(){
TOP_ESP=0;
try{
ChckStack();
}
catch(...){
return TOP_ESP & 0x00004000;
}
return 0; //Never Happens Throw a bone to Bill Gates
}
////////////////////////////////////////////////////
This will give me the TOS! It relies on pushing the stack until it trashes,
and assumes that it is on Page Boundaries. Any more'System' ideas, or Any ideas to find the base of the stack?
regards
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: in a running program in a System way
What do you mean by this?
Steve
|
|
|
|
|
I Meant, maybe there is an API somehere that does this in a Microsoft Approved documented way, rather than the kludge I wrote to get the allowable range of ESP. It has all to do with a custom version of longjmp, which saves away a portion of the stack before it 'jumps'. Later on, after many function calls on the cut down stack, the portion of stack is retrieved is put back.If all goes well (an there are many reasons why it should not), a bit of gerrymandering of the various registers will cause the saved process to resume where it left off. The above is ofcourse a gross simplification, we have all sorts of things to consider, starting with global variables.
In order to trap the worst of errors, it would be handy to be able to do a sanity check on the proposed value for ESP before you take the jump back. What I wrote sofar works quite well, amazingly well actually, all things considered, but, it will end up as a minor(and thankfully well hidden) part of an API for third party users. In a situation like that I feel that belts, braces, and all rescue gear available would be recommended to be in place.
Hence my request
LateNightsInNewry
|
|
|
|
|
See here[^].
Here's some code to get the limits of the stack:
#include <windows.h>
#include <iostream>
int main(int argc, char* argv[])
{
DWORD top;
DWORD bottom;
__asm
{
mov EAX, FS:[4]
mov top, EAX
mov EAX, FS:[8]
mov bottom, EAX
}
using namespace std;
cout << hex << showbase << "top = " << top << ", bottom = " << bottom << endl;
return 0;
}
Steve
|
|
|
|
|
Sorry for the thread highjack, but...
Cool! Thanks for the link
|
|
|
|
|
Thanks Steve,
Your answere points in the right direction. This however appears to give the TOS Committed Page Linear Address. What I would be looking for is the TOS Reserved Page Linear Address. When trying to rebuild a saved stack, After other processes played havoc, the committed stack could well have depleted. (we were not using that portion of the stack after all). The stack adjustment we are talking about here, has been known to span several hundreds of kByte.
Hence, in this case, the stack to be restored, should not be compared to the committed pages, but the the reserved pages.
regards
LateNightsInNewry
|
|
|
|