|
I have created a COM collection object for use by our UI team, but now requirements seem to have changed and they no longer want COM collections but something like ADO recordsets they can bind to their grids. It seemed to me that a data bound control is probably just using an interface on the ADO recordset objects to navigate the collection. And since I already had my COM collection implemented, if I could implement this mysterious DataSource interface I could make everyone happy. Can anyone give me a push in the right direction? What interface do I need to implement in my COM collection to act as a DataSource for a VB Data Bound control? Thanks in advance.
|
|
|
|
|
Take a look at the ATL OLEDB data producer classes1. Many grids support OLEDB as well if I'm not mistaken..
Just fire up an ATL project, and add an OLEDB data producer class using the ATL wizard, and go on from there.
1 I'm not sure this is the correct name. I'm 100 miles from home, so I can't lookup the name right now. But just look at the ATL wizards and you'll know it when you see it.
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
hi,all
I write a COM Dll in Visual ATL . And I refer the COM dll in VB environment. The vb program runs well except when the program exit, the error dialog occur. The error info are such as "the address can't read ..." . Is it concerns with
the c++ pointer ??? But how can I find the actuall false??
Are there any tools to help to debug the com dll??
The problem disturb me for very long time .
Ask for your help , please !
Regards.
|
|
|
|
|
Best way is to load the ATL project to the MSVC and set up the visual basic as a startup exe. Then when you press f5, the VB will be started. You can work with the VB as you want, e.g. load some test project, but you can put the breakpoints to methods of your DLL and the execution will stop there in case it will be called...
|
|
|
|
|
hi,
thx.
I can debug the com dll following your advice.
Because just when my vb program exit the errors occurrs,
I set breakpoints in destructor function . Then when I exit the vb program ,it seemed the program did not execute the destructor code. It did not pause on the breakpoints,instead there showed a error dialog "Unhandled exception in P2P.exe : Access Violation".
If I direct run the vb program without the debug mode , when I exit the vb program I will receive such error message"the memory address can't be read..."
why?? I am exhausting now after so much try.
thx.
regards.
|
|
|
|
|
Hi,
well have not exactly an idea, only what I would check very carefully are the circular references in VB. I think, that the similar things happened to me some time ago, when I 'developed' a circular reference through three objects and the VB garbage collector didn't detect it and failed on some exception.
What can be next thing is some topics similar to it - returning a pointer to memory which is later freed inside the component (normally one should return a copy of the memory, because VB will release it later) and similar thingiez.
In short, first who will be suspect for me in such a case will be the VB garbagge colector.
|
|
|
|
|
hi
But how can I solve this problem . You know ,anyway ,if the program have such a bug ,my boss will not be satisfactory with me. I have try many times these days, but failed.
Can you give me some advice on how to resolve this problem. It'll be appreciated.
thx.
regards.
|
|
|
|
|
Yeah. Bosses are allways the same. Anyway, this is very difficult question. It depends on the program design. Normally I am checking nearly everything regarding all return values especially returning some memory structures (BSTR, VARIANTS, arrays...). Also I am checking the dependencies and ownerships you can sometimes see, that object A points to object B and object B points to object C while C points to A - this is exactly the situation where VB garbagge collector crashes. Good luck!
|
|
|
|
|
Hello,
I am trying to replay a set of recorded events in WebBrowser. I am able to record and replay the events like keypress and click events on the html page displayed in the browser.
However, when i am replaying events like keypress into a text box and then a click on submit button, the application does play the events but i am not able to see the text entered inthe text box on the HTMl page.
Similarly if there more text boxes and events are replayed on them then the text is seen only after the function for replaying of events returns.
for e.g. Google's page has a textbox and Google search button. If i just record events in the text box without clicking on search and replay them back i am able to see the text in the textbox after the replaying is complete. However if i also press click on the search button and try to replay these two events then the app puts the text and clicks the button and navigates to result page and thus the events are replayed properly, but the text is not seen in textbox before navigation.
Further info:
I am using WebBrowser in VC++ and IHTMLDocument2 pointer. With this i am able to get the HTML of the element and compare it with the recorded event's HTML. When i find the element(IHTMLElement) i use either a click() or put_innexText() api's depending on whether it was a click or a keypress event.
I have tried to run the function which replays events in OnDocumentComplete(), directly and then again inside a thread so as not to interfere with the documentcomplete process. I have also tried to use sleep in OnBeforeNavigate().
Secondly, I have tried to use PostMessage and SendMessage and keybd_event() apis to see if they make any difference. All this has failed.
Please somebody help me with this. Thanks in advance.
Regds,
Prasad.
Prasad
Thanks again
|
|
|
|
|
modified, after read it completely . just a wild shot - maybe IE needs some time to refresh it's window, or, this might depend on the app design, somehow during the playback, the IE window messages are not handled or something like that (this can be specially if your player is an inprocess component and it seems to me that it is).
If I looked to furhter info, it looks to me so, that you fill the textboxes or whatever, but there is no time to display it.
What I will try on your place is to process the messages after each change (PeekMessage, DispatchMessage...). This might help
|
|
|
|
|
Thats right IE basically is not updating the component after the text is entered. It does have the time to update it. I am iterating through a linklist picking up events and then firing them, so i just need to get out of that loop. Say for eg by displaying a dialog box.
I have currently solved this problem by using postmessages and sleep in my dll.
Thanks anyway, I will try to check out ur solution too and let u know.
Prasad
Thanks again
|
|
|
|
|
Hi All,
I'm trying to set a top-level exception call-back filter inside a com+ application server.
Although SetUnhandledExceptionFilter seems to succeed, that it returns the previously installed filter correctly, my filter never been called.
of course I'm trying to detect the call in a (release mode) through a simple code that creates a log file to be filled later with the proper informations I need for recovering.When calling the filter from a __try/__except(MyFilter(..)) block, the filter code executes correctly, but when generating a purposly unhandled exception the file is never been created.
Any idea?
Regards.
AbuMalek
|
|
|
|
|
hi,i am trying to save the ppt file into html,
and i call "saveas" to do it,but if the ppt file
is bigger ,it very slow!! how to make it faster??
welcome
|
|
|
|
|
hi all,
i want to make a plugin for my internet explorer..can i do so in vc++ or using com...i dont have any idea..if someone can help please do so..
best regards...
himanshu
|
|
|
|
|
For IE you have to play with MS COM, as everything is exported through interfaces. So you can do it in VC++ using COM .
What kind of plugin it should be? There are different plugins for IE - protocol plugins, some toolbars...
|
|
|
|
|
hi,
Thanks for ur reply..i want a plugin that does a specific work for IE..e.g.as google toolbar..i hope this can be created..
regards
Himanshu
|
|
|
|
|
|
hi,
thanks for ur help..i am trying to develop this in vc++...ur help as nice though...i appreciate ur support...
thanks a lot...if there is anything u find..pls send it to me..
himanshu
|
|
|
|
|
The project I'm working on is moving from good old DCOM to COM+. I find it hard to solve one issue. Back in DCOM days, when you had data that had to shared by all the objects of a class, there was no problem holding inside the DCOM EXE server and letting all instances know of it (data such as a list of connected currently connected users, etc).
How do I do it in COM+, as all objects are created through surrogate DLLs ?
Thanks,
Omer.
|
|
|
|
|
If you are using a C++ server, it's simple, it's just a matter of creating a global DLL variable.
If you want to use the COM+ way, or for VB DLLs, you can use the Shared Property Manager (SPM), which is designed exactly for this.
I see dumb people
|
|
|
|
|
I need a whole Data structure (and not a simple one). If I understand correctly, what you suggest is to wrap it up with COM and pass it around to all instances this way or another. Isn't there a simpler solution ?
|
|
|
|
|
No you don't need to wrap it with a com object, simply you need to keep your data structure as a global variable to the dll module then provide a code that manipulate that structure with a multi-threaded-safe fasion and you are done.
if you want to avoid writing syncronization code you can rely on the sahred property manager as daniel advised.
AbuMalek
|
|
|
|
|
I would like to know how to implement a schedule in VC. I am familiar Java than VC. In Java I did use Timer and Thread. But in VC, I dont know.
Please drop to me some line if you know!
Thanks
|
|
|
|
|
Uhm, this forum is about COM. You probably want to ask your question in the Visual C++ forum.
When asking the question in the Visual C++ forum, also specify whether you're using ATL windowing, MFC or Win32. That would help people help you better.
--
If I had the ability to smooth talk like John Simmons, this post would be less sarcastic and more to the point.
|
|
|
|
|
I'm trying to insert an object from a file into a document. How does the filename get passed to the OLE server to open it up to display into the container application.
thanks
|
|
|
|