|
1. Link in the MFC libraries (either static or dynamic) using the project settings wizard.
2. Add #include <afxdisp.h> to StdAfx.h atter the #define STRICT line...
You must be using VC 6 for this to work. If using earlier versions its a little harder. MSDN has an article. "How to add MFC to ATL...
Here's is a snip from one of mine.
#define STRICT
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
#include <afxdb.h>
#include <afxdisp.h>
#define _ATL_FREE_THREADED
#include <atlbase.h>
Thanks for the help,
Bill
|
|
|
|
|
I want to use VB COM+ DLL from C++ console application or C application and not to lose COM+ functionality (JIT, scalability...), I managed to call it from C++ console application but only when component is registered like librabry application, when component is registerd like server application I
get following error when creating object :
'creating object
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER ,__uuidof(_cFMlogic),
(LPVOID *) &t);
'error
hresult= -2147221164, Class not registered
|
|
|
|
|
Hello,
I have some problems with the registration of my NT service.
When I register the service as an DCOM server, I can not specify
my remote server with his IP address but only with his network
name but when I register the same component as a NT service,
the IP address and the network name work.
Has anybody already met this kind of problem ?
Thanks by advance.
|
|
|
|
|
Hi,
I've been having real trouble getting to grips with how to package in a cab file and sign a active x control for use in a web page.
I have all the componets i need (i think)
a .ocx , .spc , .pvk and a .ini that i have made which seems to be correct becuase i can use it in a web page to setup the active x control.
but i have used the cabarc.exe tool, but i can't then embed it in a web page as the codebase item, IE just starts to open the page, then the icon turns to an X, and thats it, no error message.
Any help or guidance would be real helpful,
Thanks.
|
|
|
|
|
Hi,all
I want to install com+ applications and web site in my setup program.Then how to do in install shield?
sandos
|
|
|
|
|
Hi all,
What is difference between E_FAIL and S_FALSE ???
Thanks for helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
E_FAIL (0x80004005) indicates, that the function fails. No further processing is possible (e.g. an object cannot be instanciated). Script languages are throwing exceptions in this case.
S_FALSE (0x00000001) indicates, that the function has no effect or has no results. In script languages no exception will occur.
Volker
|
|
|
|
|
These can also be used to inform of fatal and non-fatal errors.
S_FALSE may be returned from a method when it partially succeeded. For example numbers were calculated correctly but were of insufficient range.
HRESULT Calculate(int x, int y)
{
if( x > 5000 || y > 5000)
return E_FAIL; // return failure because these numbers are greater than
// possible range expected
if( (x + y) < 500 )
return S_FALSE; // return false because it worked but just wasn't high enough
else
return S_OK;
}
|
|
|
|
|
E_FAIL will also throw an exception if you use Visual Basic, and S_FALSE will not.
|
|
|
|
|
I am using an asynchronous property in my ActiveX control to implement the background of my control.
What should I do to implement the property?
Is there any articles about the topic?
Thanks.
Maer
|
|
|
|
|
Why use the statement "EnableCompoundFile()" in the function "CMyServerDoc::CMyServerDoc"? Here, "CMyServerDoc" is a class derived from the class "COleServerDoc". My application is a MDI based server application.
Does it have anything to do with "COleServerItem"?
|
|
|
|
|
In a com application, I am putting a vector in a varinat , and sending it. I have problems while retreiving the vector from variant. Can u suggest some solution to this.
Thanks
Madhavi.
|
|
|
|
|
Check this variant and safearray sample by Ron Jacobs
http://www.sellsbrothers.com/tools/CComSafeArray.zip
It may help you out, as I really did not understand the vector bit !!!
|
|
|
|
|
In a com application, I am putting a vector in a varinat , and sending it. I have problems while retreiving the vector from variant. Can u suggest some solution to this.
Thanks
Madhavi.
|
|
|
|
|
Hey,
I wanted to send DISPARMS as the return argument in one of the COM method.
Can u suggest some solution to this.
Thanks
|
|
|
|
|
I want to release memory in com when i need to do it. I don't want the system to do it. How can i implement it?
|
|
|
|
|
memory means you r want to delete the pointers ?You can release them by calling Release() method of IUnknown interface.
Pathi
bhikshapathi_g@semanticspace.com
|
|
|
|
|
Hi everyone,
Well my propblem goes like this. First of all i want to let you know that the project that I have developed works under WinME , Win98SE and Win95B without any problems. I ran into this problem when someone wanted to install this on a Win95A machine. We also found out that this problem is also consistant on a win98 machine too. This project is being developed for the Federal Aviation Admisintraion (FAA) for Windows98 first edition based machines.
Well i developed this project with 4 activeX components and compiled this program and then used install shield to make a distribution of this program. When i installed this program on the WIN95A and Win98 machines they did not put the proper icon on the desktop. They inserted the MFC icon for its executable. That gave me an idea that soemything was wrong. After that i tried to run the program with double clciking on the icon and the hour glass ran and nothing happened. I found out that that machine had a 16 bit FAT partition so i tranformed that into 32 bit on the Win98 machine with its utility. Win95a u dont have this option ofcourse. I also used REGSVR32.exe to register the COMDLG32.OCX object. But this object in my instalation file was there without the DLL file. So i went ahead and registered that and it was succesful in registering. I rebooted as usual and nothing was working again. But the icon was correct this time. Well after that i decided to install VC++ compiler on that machine and saw that the project hada problem registering the AvctiveX Components. So i couldnt recompile the project on that machine to get this thing to run.
Well i am pretty much running out of options. I read afew articles that were online but i am a little puzzled. I need a little bit more insight and someone to tell me what exactly the problem is.
Thanks for your help
|
|
|
|
|
Why I can not implement a class synk in my client for the tipe objectEvent form the Server???
And what I must to do to have in my client just a class synk in witch a call just invokeHelp....????
thanks
Bogdan
|
|
|
|
|
Hi can anyone point me in the direction of any good COM+ resources or websites, specifically I'm interested in COM+ events.
Thanks
Phil Harding
|
|
|
|
|
I use a asynchronous property in my ActiveX control to implement the background of my control.
In the "OnDraw" function, I use the following tactic:
if(GetReadyState()==READYSTATE_COMPLETE)
{
//draw with the background picture
... ...
}
else
{
//draw without the background pictrue
... ...
}
In the "OnDataAvailable" function:
I check the status. If the status is "BSCF_LASTDATANOTIFICATION", I will set the status of the control to "READYSTATE_COMPLETE" and force the control to redraw itself(invalidaing the control).
In the "Set" function of the property:
I just use the function "SetModifiedFlag".
My Question is:
If I changed the value of the asynchronous property, can the background of the picture redraw automatically? Shall I add a statement to reset the status in the "Set" funtion of the property?
Thanks.
Maer.
|
|
|
|
|
I have read some articles about the benifits of the Compound File and structured storage. In my opinions, I think one of the benifits of the Compound File is that we can load only a part of the whole document that we need and not have to load all part of the document. It saves a lot of time and simplified the programming.
In the Container Application, the functionality is very clear. For example, suppose a CxxxDocument that contain several bitmaps, we can only load the right one that we want to edit by activating the item from the representation chart. The memory only load the exact part of the document.
I have used the VC++ Debug Tools to trace the MFC source codes of it. I find out the MFC Framework use a linklist data structure to store and load the OLE Items from the document.
But in the with Server Application, the functionality is not very clear. I also trace the MFC source codes. I find out the server document also use a linklist data struture to store and load Server Items. If we use "embed" tactic, there will be only one node in the linklist. If we use "link" tactic, there can be more nodes in the linklist.
It is well known that the Compound File can contain items and use them individually like the document of container application containing OLE items in the linklist.
So my question is: Since the document of the server application is Compound-File enabled, the document also can contain items to manipulate. Are the objects of class COleServerItem the items that we can use structured stroage tactic to manipulate(like the OLE items in the container's document)? Are they built on the basis of COM? Or are they only pure ordinary data streams in the document and these kind of objects can not be manipulaite individually.
Thanks.
Maer
|
|
|
|
|
In the "OnCreate" funtion of the class "CInPlaceFrame" of a Server Application, there is a statement like this "m_dropTarget.Register(this)". Here are the comments from Microsoft:
// By default, it is a good idea to register a drop-target that does
// nothing with your frame window. This prevents drops from
// "falling through" to a container that supports drag-drop.
The statement really puzzles me. When we are programming in a Container Application, this statement is to register a drag-drop target. But in a Server Application, I can not see the funtion of the statement. If I remove the statement, my server application runs like before.
So my question is:
What is the function of the statement "m_dropTarget.Register(this)"? Can you give me an example?
Thanks.
Maer
|
|
|
|
|
How can I get VB interface to my VC project???
plz help me.
|
|
|
|
|
You can expose methods in your VC project using by making a COM object. The details of this are a deep and long subject. Consult MSDN for a while.
or, Use Add New ATL Object and follow the wizard...
Thanks for the help,
Bill
|
|
|
|