|
What values do 'pOuter' and 'dwClsContext' have?
Bear in mind that if dwClsContext is too restrictive, you can't launch the server.
Steve S
Developer for hire
|
|
|
|
|
dwClsContext=CLSCTX_LOCAL_SERVER
(I use com object from the local computer, in another proccess, and it seems that this parameter have right value)
pOuter = NULL (?maybe in this problem)
|
|
|
|
|
The redemption stuff is packaged in a DLL, so you might want to try CLSCTX_SERVER (or even CLSCTX_INPROC_SERVER explicitly) and see what happens.
It's unlikely that pOuter = NULL is your issue, unless Redemption insists on being an aggregated object, which I doubt.
Steve S
Developer for hire
|
|
|
|
|
I tried with all this flags also, but nothing good happens.
I have solved my problem with MapiEx. Thanks for help.
|
|
|
|
|
Hi,
I want some instructions in converting existing C# Windows Application to C# Web Application..
Please post your replies as soon as possible.
|
|
|
|
|
If the application has been properly architected it should just be a matter of rewriting the presentation (UI) layer - perhaps with the odd addition elsewhere to support a stateless model of working. If it hasn't been well architected then you are looking at rewriting the whole application.
|
|
|
|
|
Spamming different 10 forums with the same question is very rude and totally unnecessary.
And i fail to see what rewriting an application under Windows Forms has anything to do with COM.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi there.
I am working on developing a geobase scientific application. I need a control/component that I could put on a form view and use as map for a user to create watersheds and retrieve GIS information from it. While searching for such control I came across the MapWindow ActiveX control developed by a group of scientists at Idaho State University. On their website they also posted several sample projects, form-based VS2003 .NET included with manual/tutorial [^]. I was able to register the control and run the sample project. Everything worked fine and it did display the maps flawlessly. The problem begins with the MFC type project. And that's exactly the type of application I am working on.
I am a newbie to the COM and ActiveX controls under the MFC. I used excellent Michael Dunn's article[^] as a guide to getting the MapWindow ActiveX control to work. I realize or at least I think that MapWindow.ocx file is a COM object and we need to get a pointer to the objects within that control using the wrapper interface classes and so on, but for example when I try to get an access to the IShapefile interface the compiler says that there is no interface.
I tried to get help from their forum but noone responded yet.
Have someone had an experience in hosting the MapWindow ActiveX control in the MFC project? I'd really appreciate any help?
Thanks in advance,
Alex
P.S. Here are the snippets of the code that I wrote within CFormView class in order to get an access to the IShapefile interface that is of a coclass Shapefile in the MapWindow Control:
if( FAILED(CoInitialize(NULL)) ){
::AfxMessageBox( "COM Library Init Failed" );
::AfxAbort();
}
IShapefile* m_pShapefile = new IShapefile;
CLSID CLSID_Shapefile;
::CLSIDFromProgID( L"MapWinGIS.Shapefile.1", &CLSID_Shapefile );
IID IID_Shapefile;
hr = ::CoCreateInstance ( CLSID_Shapefile,
NULL,
CLSCTX_INPROC_SERVER,
IID_Shapefile,
(void**) &m_pShapefile );
if( SUCCEEDED( hr ) ){
CString s = "world_adm0.shp";
m_pShapefile->Open( s, NULL );
}
|
|
|
|
|
Hi All,
i have an interface which exposes 2 methods.
The coclass has a member variable of type
X *p;
from my applicationi call method 1.
in method 1
i do
p = new (class y); // class y inherits from X.
again after call to method 1 i call method 2
in method 2
i do
if(p)
delete p;
i get an exception when i try to delete.
i do coinitialize etc..only once and then release, couninitialize after method 2.
please help
Thanks & Regards,
Dhana
|
|
|
|
|
Since you're deleting a pointer of base class type, it's imperative that the destructor is declared virtual . If not you'll probably get an exception.
If you have declared your destructors as virtual , I suggest you post some code that shows the destructor definitions and how your p variable is declared.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I already have the base class destructor set to virtual.
Thanks
Thanks & Regards,
Dhana
|
|
|
|
|
jana_dhana wrote: I already have the base class destructor set to virtual.
Ok, so where's the code snippets I asked for?
From what you have described in your first post neither prasad nor I can find anything wrong, so we're just guessing at this point.
My guess was that you could have forgotten to declare the destructor as virtual, but I also suggested that if you've already done that you should post some code. Since you haven't posted any code at least I don't have any better guess.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
To add to roger's suggestion,
jana_dhana wrote: if(p)
delete p;
It is good practice to set pointer to NULL , after deletion, and no need to check pointer for NULL . It is safe to call delete on NULL pointer.
you can modify your code to,
delete p;
p = NULL;
And obviously, its needed some more code to see, to track down the problem.
|
|
|
|
|
Please note that in method 1 i just create the object and assign it to pointer
in method 2 i am checking that if it was already created then i dont want it now and want to create a new object and assign it to the pointer.
but in method2 when i try to delete the object which was created in method1
it causes exception of unknown type.
Thanks
Thanks & Regards,
Dhana
|
|
|
|
|
Its seems diificult to judge. But, Initialize pointer you are talking about in c'tor of your coclass. I'm sure in method2, you are deleting uninitilized pointer(which is not set to NULL).
|
|
|
|
|
Hi to All,
Could any one Help me, How to create the plug-in toolbar for windows live Messenger using vc++?
What should I do?
Advance thanks
Ramana AV
|
|
|
|
|
Hi,
I have an existing COM which is up and running...now i have added another method in the COM but when i am trying to call that method from the client application I am getting an exception:
0x80004003:Invalid Pointer
Both my COM and the client application are written in VC++
Can anyone help me out with this??
Thnx,
Priya
|
|
|
|
|
When you modify interface, you need to change either major version number or minor version number. Have you done that ?
Refer this[^] for more inof.
|
|
|
|
|
Hi,
I haven't changed any version. So can u tell me how to change the version??
I am new to COM and so i donno this...
Thanks
Priya
|
|
|
|
|
In your .idl file , there must be block like this,
[
uuid(2EF0C5B1-0E6D-4793-8897-51BC19A18F58),
version(1.0),//this is version number
helpstring("Project name 1.0 Type Library")
]
Modify this to,
[
uuid(2EF0C5B1-0E6D-4793-8897-51BC19A18F58),
version(1.1),//this is version number
helpstring("Project name 1.1 Type Library")
]
|
|
|
|
|
Hi,
Thnx for the help..I tried it out but it didn't work!!
I changed the version number and the helpstring and tried attaching that COM .tlb file again..but still the same error is coming..
Any other solution??
Thnx
Priya.
|
|
|
|
|
I dont see any ohter problem. See, using your component, in other clients like VB.
I'm feeling, some how , your added method is not getting recognized.
|
|
|
|
|
Hi
The COM interfaces in my application derive from IUnknown. But some interface functions are declared using the "THIS_" parameter, some with "THIS" and some with none. For example:
1. STDMETHOD(DoBlah1) (THIS_ UINT uNum) PURE;
2. STDMETHOD(DoBlah2) (UINT uNum) PURE;
3. STDMETHOD(DoBlah3) (THIS_) PURE;
4. STDMETHOD(DoBlah4) (THIS) PURE;
5. STDMETHOD(DoBlah5) () PURE;
I would like to know whether the "THIS_" or "THIS" keywords are necessary, and what would be the difference between these functions.
(I couldn't find the definitions of THIS or THIS_ in the VC browser or on the net... )
Cheers
d3m0n
|
|
|
|
|
THIS_ , THIS and PURE are macros defined in basetyps.h and objbase.h. They are used for portability reasons with plain C, thus the code will compile with a C-compiler if written correctly.
Have a look at Jeff Glatt's article serie about COM in plain C. You'll find the first article here[^].
You'll find the other parts, 2 to 8, in various chapters below the COM section here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thank you very much Roger, that is a perfect answer for me.
I'll ensure that all my interfaces contain the THIS_ and THIS macros.
Cheers
d3m0n
|
|
|
|