|
You need to identify activeX in your project and use following line from commandline
regsvr32 /u "activeXFile"
RegSvr32[^]
|
|
|
|
|
Hi experts,
I want to add a com dll file in my project.I wtitten the below code to create a pst file in c drive.
Program compiled successfully
But the function Logon() goes fail and sows a exception :
"Unhandled exception at 0x7c812a5b in samp.exe: 0x0EEDFADE: 0xeedfade."
CoInitialize(NULL);
IRDOSessionPtr session;
HRESULT hr = session.CreateInstance(__uuidof(RDOSession));
session->Logon(" ",NULL,NULL,NULL,NULL,NULL);
session.Release();
what is the problem.Is there other way to add com dll in prject.
Plz tell
manu
|
|
|
|
|
You should always check the returned HRESULT value, i.e.
if (FAILED(hr)))
{
}
and never use the pointer (even the smart ones ) if the
CreateInstance failed.
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.
|
|
|
|
|
Whats return value of hr?
|
|
|
|
|
Again this is malini.I dont know how to start. Suppose i am connected to net. And http://WebSite/ResourceName?Data=Data....... is the address. Can i find the address using C++. Does there exists any class for this?
Thanx in advance friends!!
Malini
|
|
|
|
|
Malini Nair wrote: Suppose i am connected to net. And http://WebSite/ResourceName?Data=Data....... is the address.
You can be connected to more than one site at a time. IE has an automation interface that you can use to enumerate the currently open URLs.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Hello, I am writing an outlook DLL, it is for a phone system and when a call is received I search through the outlook contacts (using called ID) find the person and open the contact in a window.
My problem is that this locks up outlook. When I open the contact under a button, e.g.
void __stdcall CAddin::OnClickButton2(IDispatch* Ctrl,VARIANT_BOOL * CancelDefault)
{
USES_CONVERSION;
CComQIPtr<office::_commandbarbutton> pCommandBarButton(Ctrl);
static Outlook::_InspectorsPtr inspectorsPtr;
static Outlook::_InspectorPtr inspectorPtr;
Outlook::MAPIFolderPtr pFolder = m_spApp->GetNamespace("MAPI")->GetDefaultFolder(olFolderContacts);
Outlook::_ItemsPtr pItems = pFolder->Items;
Outlook::_ContactItemPtr pContact = pItems->GetFirst();
inspectorsPtr= m_spApp->GetInspectors();
inspectorPtr = inspectorsPtr->Add(pContact);
inspectorPtr->Display(vtMissing);
}
This works fine, when I put the same code in my dll, e.g.
static void openContactOnCall(char* number)
{
static Outlook::_InspectorsPtr inspectorsPtr;
static Outlook::_InspectorPtr inspectorPtr;
Outlook::_ContactItemPtr contact = findContact(number);
if (contact)
{
// Contact is valid
inspectorsPtr= m_spApp->GetInspectors();
inspectorPtr = inspectorsPtr->Add(contact);
inspectorPtr->Display(vtMissing);
}
else
Debug("Didn't find contact");
}
A window opens with the contact but outlook then freezes. The contact must be valid as I see the correct name in the windows title bar. I have triggered outlook as it does open the window.
I've hacked around with this for sometime, and haven't got anywhere. I am clearly missing something quite fundamental but the fact the same code works under a button but not in the dll has got me confused, and shows that I do not understand something fundamental to how this should be working. Any help would be greatly appreciated.
Gavin.
|
|
|
|
|
Hi all,
I am partly through creating a console application that runs a Windows app. All this I have managed to perform, but the following I am unsure of.
I now need to bring the form to the current view (which I have achieved), then put the mouse pointer in a certain position then simulate pressing the left mouse button.
Can anyone suggest where I need to start looking to allow me to work this one out ?
Pete
|
|
|
|
|
Fritzables wrote: then put the mouse pointer in a certain position then simulate pressing the left mouse button.
Is mouse_event() of any help here?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
G'Day Dave,
That sounds the GO, but what about getting the Mouse Cursor in the position I want ?
Pete
|
|
|
|
|
i guess the right way would be the SendMessage function. use it with the parameter WM_LBUTTONUP.
walter
|
|
|
|
|
Thanks Walter..... have a look at the reply I shot Dave.
Pete
|
|
|
|
|
I am not sure about a console application.
In Windows the mouse pointer is called a ‘cursor’ and you can set the position by calling SetCursorPos(x,y). Note that if ClipCursor was used to limit its rectangular area of movement then it will remain in that area.
After setting its position you can post the button-down and button-up messages, in that order, to simulate a button press & release.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Thanks John,
Yep, got the cursor now moving all over the place using the Cursor->Position. I will now concentrate on the mouse clicking now.
Thanks again John.
Pete
|
|
|
|
|
You are welcome,
Just a thought that this may come in handy, if do not have the have the handle to the button and have the handle to the parent then you can call ChildWindowFromPoint to get it. I guess that if you know its coordinates then you already have the handle; anyway I thought I would pass that along.
John
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi friends.. tis is M.V.Nair. I am now doing a program to track the URL(Internet) using MFC and to indicate it to the server in case if any unwanted website is accessed. First pls do tell me can we associate C++ with Internet? Pls do reply if anyone of you know tat friends!!
Malini
|
|
|
|
|
Malini Nair wrote: I am now doing a program to track the URL(Internet) using MFC
you need either knowledge of COM to implement the project or you have to hack through the different browser using FindWindow api to reterieve the website name
"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
Support CRY- Child Relief and you
|
|
|
|
|
Malini Nair wrote: using MFC and to indicate it to the server in case if any unwanted website is accessed.
This is best done at the router; anything you can do on the client side can be undone or usurped. The added benefit of doing it at the router is centralized logging.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi All,
As per our design my application should launch in the system startup itself.
and also my application require the privilegeg level as "requireAdministrator"
to function proper. So i added one manifest file and in that i mentioned the snippet below
<security>
<requestedprivileges>
<requestedexecutionlevel
level="requireAdministrator"
="" uiaccess="false">
with this everything is fine.
But the problem is that when the system restarts, My Application is geeting blocked,VISTA prompting "Windows has bloked some startup progrsms" this is not expected for my application.
how can i avoid this. i.e how can i start my application in system startup?
Please support me in fixing this problem?
Thanks in Adv,
Are
|
|
|
|
|
You can't, this is by design. Vista won't run an app at startup if running the app would result in a UAC prompt.
|
|
|
|
|
hi,
When I am trying to run the my dll and program use it in release mode it crashs on these lines:
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()<br />
<br />
{ ASSERT(afxCurrentResourceHandle != NULL);
in AFXWIN1.inl header
What can be the cause for that ?
It functions perfectly in debug mode.
Thanks,
Ohad
|
|
|
|
|
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.
|
|
|
|
|
You should use the debug dll in Debug mode,and the Release dll in release mode.
|
|
|
|
|
This is what I am doing.....
|
|
|
|