|
georgekjolly wrote: am doing a project using COM. I need to embedd my own html page as a frame in a page accessed from internet.
Thats probably the weirdest thing i heard, why would you want to do this?
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
Hi,
I've used the MFC class wizards in VC2003 to create a wrapper for an ActiveX control (derived from CWnd). I've then successfully embedded that control into a window and it works beautifully (so far so good).
My question is, how can I invoke the control's standard Property dialog from within MFC? I need to give the user access to the control's properties at runtime, but so far have not had any luck doing this.
Can anybody help?
- Don
|
|
|
|
|
What is the difference between these two?
Can anyone help?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
"I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."
|
|
|
|
|
None, aside from the naming convention.
|
|
|
|
|
I'm trying to modify a Event Calendar available here as a demo to use a sql database but have not been successful.
If anyone thinks they can help, or have something I can work with I would appreciate it.
Thanks in advance...
|
|
|
|
|
Hai,
I am trying to compile my application in VC++, I am getting error "file not found: ..\lib\ScriptHost.tlb". That file is not available in my machine. how to get that file? That file is included in the file
"..\Rogue Wave\Stingray Studio 2006\Include\toolkit\ActvHost\ScriptHost.rc"
Can anyone suggest me what I could do for this
Thanks
Surendran
|
|
|
|
|
I haven't worked with the tookit you have mentioned so can't give specific answer about missing file. Ideally, since its a dev toolkit, the TLB, if used, should be part of the SDK/Toolkit you have installed.
If it's not, you can use following methods to generate it -
1. If you have its IDL, then use MIDL compiler to generate a TLB
2. If you have its COM component registered on system and assuming it has the TLB embeded in it, you can use OLE/COM object viewer to get the IDL file code and use step 1 to generate it
There might be other ways to generate it, but I need to fix few things myself, so can't think much at the moment Hope this helps.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I would have thought that if you've paid for a RogueWave toolkit then you're entitled to a certain amount of support from RogueWave ?
'g'
|
|
|
|
|
I have a bug in .NET which I'm trying to repro for Microsoft. To repro this bug, my app needs to respond to events raised by a COM object.
In my app, this object is iTunes. However, for my repro, I want to use a COM object already installed on a common XP setup.
So - are you aware of a COM object I can create in my app, which raises events for which I can create a handler?
Preferably, this COM object has a UI (in fact, is an application), so I can control when the events are fired. For instance, with iTunes I create an instance of iTunes, then create a handler for the VolumeChanged event, then I click on iTunes and move the volume slider. Each change sends an event to my app.
Also preferably - very little code. I can do the above with iTunes in three lines of code. I'm not interested in learning about another COM object, just using it to demo a bug. So if you can provide those 3 lines of code, more power to you! (and me).
Thanks!
|
|
|
|
|
How about WebBrowser control for instantiating IE. (see IWebBrowser2 interface and its related events)
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
That would have worked nicely, thanks.
However, I was able to fix my bug (you can see the thread over on C# if you are interested). Turns out that my event handlers for the COM object were not executing on the same thread as my form, and I was getting odd UI behavior as a result.
I needed to check .InvokeRequired, and call Invoke() if necessary. I fixed this, and every last little bit of the bug just disappeared!
I still don't know why .NET wasn't throwing "wrong thread" exceptions, but that was definitely the problem.
You can see the thread and a very nice explanation of the problem here:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&fr=26
|
|
|
|
|
Cool. I agree, there are problems with events when multiple threads are involved. Need to be a bit careful
I was unable to get to the thread using the link you provided
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
JoeRip wrote: Turns out that my event handlers for the COM object were not executing on the same thread as my form, and I was getting odd UI behavior as a result.
Awooga! Awooga!
Sorry, that's the sound of the alarm going off in my head.
Something's not right with your apartment setup. If you have forms, the thread that creates them should be marked with the [STAThread] attribute. This ensures that COM events are fired on the correct thread - it tells COM that this thread uses the apartment-threaded model (CoInitializeEx is called with the COINIT_APARTMENTTHREADED flag). Objects created by this thread have their calls sent back to this thread, regardless of which thread those calls were made from (if the object is implemented correctly).
The object is also marked for a given threading model - this is done in the registry for objects implemented as in-process servers (in DLLs). Normally automation objects are also marked apartment-threaded - this means that whichever thread you make a call to them on, COM will marshal the call to the thread you created the object on. However, COM can only do its stuff if you correctly marshal interface pointers between threads - if you just pass raw interface pointers around you can end up calling an object incorrectly on the wrong thread when it's not expecting it, causing unexpected race conditions or other thread-model violations. This is a particular problem if an event has to be raised by a worker thread.
This shouldn't happen if you're using an out-of-process object though, since those calls always need to be marshalled, which leads me to think that your UI thread isn't marked [STAThread] .
|
|
|
|
|
Ah, but it is. I'm using the standard VS .NET Windows Application template. Here's my main:
namespace Eye_On_iTunes<br />
{<br />
static class Program<br />
{<br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new frmEye_On_iTunes());<br />
}<br />
}<br />
}
and all of my code is running in the form class frmEye_On_itunes(). Note the thread model.
To get the iTunesApp object, I simply:
itunesapp = new iTunesLib.iTunesApp();
and to create event handlers for the iTunes events I simply
itunesapp.OnDatabaseChangedEvent += new _IiTunesEvents_OnDatabaseChangedEventEventHandler(itunes_OnDatabaseChangedEvent);
where itunes_OnDatabaseChangedEvent is a handler in the form class.
So I also assumed the event handler thread would be the form thread, and that it would be safe. However, apparently it wasn't.
I added a check to InvokeRequired, and re-routed the message back through with a delegate, like this:
private void itunes_OnDatabaseChangedEvent(object deletedObjectIDs, object changedObjectIDs)<br />
{<br />
if (InvokeRequired)<br />
{<br />
Invoke(new iTunesLib._IiTunesEvents_OnDatabaseChangedEventEventHandler(itunes_OnDatabaseChangedEvent), new object[] { deletedObjectIDs , changedObjectIDs});<br />
}<br />
else<br />
{<br />
}<br />
}
and all problems went away. So .NET says that InvokeRequired is true when this event fires for the COM object itunesapp, apparently.
|
|
|
|
|
Hi,
I am trying to hook into this HTMLWindow event.
Here is what I am doing :
In MyHandler class :
COM_INTERFACE_ENTRY_IID(DIID_HTMLWindowEvents2, IDispatch)
virtual HRESULT __stdcall onunload(IHTMLEventObj* pEvtObj) { ... }
STDMETHODIMP DocumentComplete(IDispatch *disp,
VARIANT *url) {
....
HRESULT hr = S_OK;
LPDISPATCH doc_disp = NULL;
CComQIPtr<ihtmldocument2> doc;
hr = browser->get_Document(&doc_disp);
doc = doc_disp;
....
SomeOtherFunc1(doc);
}
void SomeOtherFunc1(IHTMLDocument2* doc) {
CComQIPtr<ihtmlwindow2> wnd;
hr = doc->get_parentWindow(&wnd);
SomeOtherFunc 2(wnd);
}
void SomeOtherFunc 2(IHTMLWindow2* wnd) {
AtlAdvise( wnd, (IDispatch*)this,
DIID_HTMLWindowEvents2, &cookie);
}
The handler class is already hooking into DWebBrowserEvents2 and all the handlers get called (DocumentComplete among them).
And I added similar code for the HTMLWindowEvents2.
AtlAdvise returns S_OK and inside it finds the CPC and the CP and Advise returns success and a valid cookie.
But onunload is not called when I navigate away from a page.
The module is a BHO dll loaded by IE.
I believe the HTMLWindowEvents2 interface is dual so I should be able to use VTBL events, right ?
Am I missing something here ?
--
Thank you!
|
|
|
|
|
i made a program with matlab gui(guide user interface).
it works so right. i have two file first with *.fig extention
second with *.m extention
my problem is how to make my program a standlone application (with *.exe extention)..
how to convert fig file to exe file in matlab??
thanks..
uLTraSLan-uNi
|
|
|
|
|
Hi,
I'm writing a COM interop interface in C# (VS2005) to be used in VC++, and got into problem of proper exporting enum-s in such interface.
When i previously used C++ for writing COM interfaces, i would just declare the enum within IDL file, and then within the library section also declare it, that way way making my enum accessible when TLB file is imported using #import in C++;
Now in C# if i declare: public enum MyEnymType {val1, val2,...}, then such object when imported into C++ project is declared as: enum MyEnymType {MyEnymType_val1, MyEnymType_val2,...} instead of enum MyEnymType {val1, val2,...}
Is there a way to make C# embed my enum type into the object in such a way that it exports original enum declaration during import instead of such an ugly Type_Value thing?
Thank you,
Vitaly
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
Please don't cross post.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My question is on C# and COM at the same time - which is the right place to post then, if not in both C# and COM forums?....
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
It is normal to post them on one forum. Pick the one that you think is most appropriate and then post it there. In this case, it is more relevant to the C# forum because that is where you want to override the enum.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Sir,
I have a third party component, which has displaying graphical chart functionality. This chart functionality is implemented as a part of coClass and an interface is provided to user. Using this interface i need to access the methods and properties of component. Could you throw some light on how to attach this component class to ole containers document window at runtime.
I have used coCreateInstance to create the class, but i want to know how can i attach this class to CWnd(window) class at runtime. so that i can get chart displayed at runtime in document window.
Thanks in advance.
Regards,
Praveen A.
praveena@navayuga.co.in
|
|
|
|
|
Probably you need to use OleCreate if I am understanding you correctly. For OleCreate you need to have an OleDocumentContainer in which you will host the control.
Look at the help of OleCreate in MSDN and tell me if you get any problem.
"Some people believe football is a matter of life and death.
I'm very disappointed with that attitude.
I can assure you it is much, much more important than that. -- Bill Shankly"
|
|
|
|
|
hello
i want to send data with com port of
a computer to another one
do you can help me with it?
thank
|
|
|
|
|
(1) The HARD side: You need a RS232 Null-modem or cross over cable.
(2) The SOFT side: It depends on the software env you're using.
(e.g. you can use Windows API such as ReadFile or the COM control MsComm ).
Hope that helps.
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.
|
|
|
|
|
if u know any thing about com port programing help me please.
thanks for your help
|
|
|
|