|
Hi there !!
Use this API GetAmbientUserMode(BOOL &bVal)
This method retrieves DISPID_AMBIENT_USERMODE. This flag indicates whether the container is in run-mode, TRUE, or design-mode, FALSE.
Regards )
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
I develop an ActiveX component with Visual Stuido .NET with ATL7.
I want to draw a icon and for that I need the instance handle of
the component. In the old way I use _Module.GetModuleInstance() ,
but that doesn't work under ATL7 in VS.NET, because the object _Module
doesn't exist!
How can I get the instance handle under ATL7 in VS.NET?
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
the _Module thingie was splitted to several more classes - see MSDN article for CComModule Replacement Classes .
The HINSTANCE is now available as _AtlBaseModule.GetModuleInstance()
hope this helps
|
|
|
|
|
Hi,
I need to fire COM events from C# and the client to handle those events is in C++.
Following is the code snippet of the COM events and the dispinterface in C#.
[Guid("12854E47-AD44-4283-B503-1176CC827A49")]
public interface Foo1ComInterface
{
void FireRequest( string str );
}
[Guid("073D1766-7969-41fd-B794-8B65B0EADAF3")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface Foo1ComEvents
{
void FooEvent( string str );
}
[ Guid("22EFEC33-5B40-4417-AFF0-DE0C5B7C9E47")]
[ ClassInterface(ClassInterfaceType.None) ]
[ ComSourceInterfaces(typeof(Foo1ComEvents))]
public class BooHoo : Foo1ComInterface
{
.....
}
So far I have generated a tlb file using regasm and did a #import in the C++ code and am able to
call the FireRequest function as defined above from C++. But how should I handle the event
fired from the .NET side. Please help!!!
Thanks,
Abhi
|
|
|
|
|
I have an OLE Automation Server (its a local server that implements IDispatch), and I am trying to debug the code, I haven't developed this code. When I create a Debug EXE, it builds ok and if I execute the debug exe by double clicking, it works just fine. The problem is - if I run this debug exe in a debug environment through VC++ IDE, it causes a Assertion Failure in one of the MFC source file, from COleObjectFactory::RegisterAll() statement in my code.
Can anyone help me understand whats going on and what to do?
Thanks in advance.
|
|
|
|
|
I have the similar problem too. Dont have the solution yet.
Its only your debug version that gives the error b'cz its only the debug dlls that have the ASSERT code. In a release version this code is not present.
|
|
|
|
|
Hi Experts,
I want to make a mimic (graphic) editor in which images will be displayed dynamically on click of button, will be resized, moved and finally, they will be connected to database. For that purpose I want to use "Kodak image edit activex control" [WINNT,VC6.0]
basically,I’ve to make a graphics editor in which when i press a specified button a picture should be displayed on the dialog.that picture will be associated with a variable in a table of a database. when the value of that variable changes in the database another picture is pasted on the previous picture.i-e a picture of engine is normal when variable is 1...but when the value is 0 the color of engine changes to red.
note:
-pictures are moveable and resizable.
-there can be alot of pictures on the dialog at a time.
-value in the database changes automatically through another program.
i m using kodak Image Edit activeX control for this purpose..i add the control in the project and create it on runtime with the help of create function
Up till now I am able to create the control dynamically with the required image displayed on it which can also be flipped on click event with the help of EventSink_Map. I m sending u attachment as well. I want to know how the dynamically created control be made able to move and resize.
any help how to do that? m i going in the right direction? bcz previously i was doing all this with the help of CBitmapButton.(information on how i did that available on demand if anyone interested)
i also came to know that exactly the same problem is encountered to "asimatta" who sent the message on EXPERTS EXCHANGE website under the topic Languages\C++\ on 08/27/2003 with the title "ImageEdit activex control??" but i coudn't contact bcoz i m unable to buy points to send a message on Experts-Exchange.com
i m really grateful to Codeproject.com for providing such a great service free!!
plz help me !! Thanking u in anticipation
Regards,
nsaadyah
nsaadyah
|
|
|
|
|
Hi guys!
How can add a property of type IAnyComInterace* to my ActiveX component,
so that it will be visible in the object viewer of Visual Basic or Visual C#?
I have a ActiveX component IMyFirstActiveX and a second ActiveX component
IMySecondActiveX . I added a property NextLogTarget of type
IMyFirstActiveX to my IMySecondActiveX component. When I try
to assign the one ActiveX component to the property of the other ActiveX component in
the source code, like (VB sample)
secondActiveX.NextLogTarget = firstActiveX
it works fine, but when I try to assign it in the object viewer of Visual Basic it will
not exepted!
I have tried severl methods of the property, here are the IDL's:
[propget, id(1), helpstring("property NextLogTarget")]
HRESULT NextLogTarget([out, retval] IUnknown* *pVal);
[propput, id(1), helpstring("property NextLogTarget")]
HRESULT NextLogTarget([in] IUnknown* newVal);
[propget, id(1), helpstring("property NextLogTarget")]
HRESULT NextLogTarget([out, retval] IDispatch* *pVal);
[propput, id(1), helpstring("property NextLogTarget")]
HRESULT NextLogTarget([in] IDispatch* newVal);
[propget, id(1), helpstring("property NextLogTarget")]
HRESULT NextLogTarget([out, retval] VARIANT *pVal);
[propput, id(1), helpstring("property NextLogTarget")]
HRESULT NextLogTarget([in] VARIANT newVal);
How can I create a property of type of a COM interface, so that it work
in the object viewer of Visual Basic or Visual C#???
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Hello,
I am hoping the DCOM gurus out there can help me with this one. Read on...
Background:
I have a COM+ component sitting on a W2K server.
I have a DCOM client that accesses the COM+ component.
For load balancing, I configure the DCOM client to go via Foundry ServerIron,
which is a load balancing and failover router.
Foundry routes it to one of the real W2K servers attached to it.
A DCOM connection pipe is established between the DCOM client and the W2K server (not Foundry.)
Subsequent calls from this client to the server bypass Foundry and use the cached
RPC binding handle.
This works fine for load balancing.
Problem:
When one of the servers behind Foundry hangs, I would like to clear
the cached RPC binding handle.
That way, any existing cached client connections are immediately terminated.
Since no cache mappings exist, the client will attempt to call the object using its
proxy settings, not the cache settings.
This will result in Foundry receiving the initial call and then transferring it to a working server.
Foundry is immediately notofied when the server hangs and so it knows not to route to the hanging server.
Question:
How can I clear the cache of mappings?
Is it possible to do something at the server side?
Is the RPC binding handle used by DCOM accessible?
Any and all responses will be gratefully accepted.
Thank you,
Sree
|
|
|
|
|
I used
#import "c:\winnt\system32\msxml.dll"
using namespace MSXML2;
for XML operations. One of the functions in my idl file is as follows.
[id(1), helpstring("method XmlEle")] HRESULT XmlEle([in] IXMLDOMNode **node);
The stuff is working fine in VC6 version. When I try to build the same in VC7, The following error is coming.
error C2872: 'IXMLDOMNode' : ambiguous symbol
could be 'd:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\MsXml.h(536) : IXMLDOMNode'
or 'd:\Samples\XMLTest\Debug\msxml3.tlh(2398) : MSXML2::IXMLDOMNode'
I tried to use the "typelib" namespace MSXML2 to prifix IXMLDOMNode pointer, but it is not working. Can anybody help, how to solve this problem with IDL file?
|
|
|
|
|
The problem is that the standard MS-includes includes the MSXML header files themself. Either you skip the import or skip using the namespace.
Pretty annoying anyway.
|
|
|
|
|
I have finished a simple component and deployed it in component Services,
then I exported the application proxy and installed it in another computer which to make as a client.
This client computer is in the same work group with the server computer.
But when an application in client uses this proxy , there an error happen : "Permission denied."
When I create a same account as the server computer and log in the client computer with this account
this application can use this proxy.
Must this account in client be the same asthe server computer?
I heard that the client and server should be in the same domain in com+,
How to configure the domain?
Where can I get some document about this?
TIA
Hello everyone
|
|
|
|
|
Hi,
I want to make a mimic (graphic) editor in which images will be displayed dynamically on click of button, will be resized, moved and finally, they will be connected to database. For that purpose I want to use "image edit activex control"
basically,I’ve to make a graphics editor in which when i press a specified button a picture should be displayed on the dialog.that picture will be associated with a variable in a table of a database. when the value of that variable changes in the database another picture is pasted on the previous picture.i-e a picture of engine is normal when variable is 1...but when the value is 0 the color of engine changes to red.
note:
-pictures are moveable and resizable.
-there can be alot of pictures on the dialog at a time.
-value in the database changes automatically through another program.
i m using kodak Image Edit activeX control for this purpose..i add the control in the project and create it on runtime with the help of create function Uptill now I am able to create the control dynamically with the required image displayed on it which can also be flipped on click event. I want to know how the dynamically created control be made able to move and resize.
any help how to do that? m i going in the right direction?bcz previously i was doing all this with the help of CBitmapButton.(information on how i did that available on demand if anyone interested)
i also came to know that exactly the same problem is encountered to "asimatta" who sent the message on EXPERT EXCHANGE website under the topic Languages\C++\ on 08/27/2003 but i coudn't contact bcoz i m unable to buy points to send a message
i m really grateful to code project for free service!!
plz help me !! thanking u in anticipation
Regards,
nsaadyah
Saadyah Nisar
NSaadyah
|
|
|
|
|
I have a problem in Win 2003 while trying to register my Serviced Component.
The type library is created, but this error is generated to me:
System.EnterpriseServices.RegistrationException: Could not install type library 'f:\moses\vb\mcad\2557abuildingcom+\democode\vb\mod02\JITTest.tlb' into application 'JIT Test'.
Server stack trace:
at System.EnterpriseServices.RegistrationDriver.InstallTypeLibrary_W2K(ApplicationSpec spec)
at System.EnterpriseServices.RegistrationDriver.InstallTypeLibrary(ApplicationSpec spec)
at System.EnterpriseServices.RegistrationDriver.InstallAssembly(RegistrationConfig regConfig, Object obSync)
at System.EnterpriseServices.RegistrationHelperTx.InstallAssemblyFromConfig(RegistrationConfig& regConfig, Object sync)
This error is generated when using Dynamic or manual regeistration
Can anybody help me in this please??
Note, I tested this app on Win 2000 Advanced Server and windows XP and it works just fine with no erros and the tlb, regeistration and installing is done successfuly!!!
|
|
|
|
|
i have added COM (xxclientx.dll) to my c# webproject.
as
using XMLProLib = XXCLIENTXLib;
& initialize as
public string GetGDSResponse(string GDSRequest)
{
XMLProLib.Client GDSClient = new XMLProLib.Client();
GDSClient.Host = "xmlpro.wspan.com";
GDSClient.Port = 8800;
etc......
}
most of times work & suddenly getting error as
System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure at GetGDSResponse(String GDSRequest)
it doesnt recover then need to restart computer ...
can you give me the solution for this.
please help me
thanks and regards
abhi
|
|
|
|
|
How can I create a simple ActiveX control, that has no GUI. I want to create a simple ActiveX control that is not visible in rutime in the client (like Visual Basic). It should be only display an little Icon during the design time in the client (VB), like the MsCOMM control.
Any link, tutorial, sample?
Thanks!
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
I believe that the switch "Invisible at runtime" does it (ATL wizard).
|
|
|
|
|
And how can I display a icon at design time?
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
simply, the OnDraw method works as before, only the results will be visible only in design mode - you don't need to take special steps.
I just tried it (because I never did it before) and the sample generated by the wizard implements the OnDraw with the standard "ATL:Test " but it was visible only in design time. In runtime it shows nothing.
hope this helps
|
|
|
|
|
Thanks! I will try it!
Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE.
|
|
|
|
|
Hi there,
my requirement is such that i have to have a singleton based exe or dll server. Dll is better choice.
Now when i use the DECLARE_CLASSFACTORY_SINGLETON macro on exe local server no problem happens and i have a singleton allright.
I have done debugging on that and the same object is returned using
CoCreateInstance
now i want to use an inproc server and i want it to be singleton as you know the requirement are but when i debug it there are seperate object formed for each client instance attaching.
and it doesn't care about the macro.
I know that for every process mapping of a dll is done but i want some mechanism of COM which let me have a single instance dll inproc server.
I need a solution to this problem otherwise i have to stick to expensive marshalling.
|
|
|
|
|
Hi there,
my requirement is such that i have to have a singleton based exe or dll server. Dll is better choice.
Now when i use the DECLARE_CLASSFACTORY_SINGLETON macro on exe local server no problem happens and i have a singleton allright.
I have done debugging on that and the same object is returned using
CoCreateInstance
now i want to use an inproc server and i want it to be singleton as you know the requirement are but when i debug it there are seperate object formed for each client instance attaching.
and it doesn't care about the macro.
I know that for every process mapping of a dll is done but i want some mechanism of COM which let me have a single instance dll inproc server.
I need a solution to this problem otherwise i have to stick to expensive marshalling.
|
|
|
|
|
Hi, I am planning to start ATL Com programming. Can anybody suggest a good starting point / online tutorial ?
Thanks
|
|
|
|
|
::CoInitialize(NULL) ?
(Sorry, couldn't resist)
|
|
|
|
|
I am working with a WebBrowser (IE). I want to know the screen position of the top left coordinate, from where the browser renders the html page i.e. top left of the page, we actually see in the browser. This should exclude the menubar, address bar, standard buttons toolbar and any toolbars like google etc. I checked the IWebBrowser2 API that give the top and left (get_top and get_left) coordinates, but its of the entire browser window. I want the one without the toolbars etc.
- Nikhil
|
|
|
|