|
guys
i have been asked to convert a simple dll that is called from vb into an activex that can be used directly in vb... the dll has only 2 functions and no gui of any kind... it doesnt use mfc or atl
what would be the best way to go about doing this for someone who hasnt done any com programming in a _very_ long time?
thnx
"there is no spoon" biz stuff about me
|
|
|
|
|
I would create a new DLL project, based on the ATL/DLL wizard template. Then I'm assuming that you want to encapsulate the original two functions, into a COM class, which you can instantiate and use from within VB. Simply create a new class in VS.NET by right clicking the project in the solutions view, and chose Add -> Add Class, and then pick ATL Simple Object.
In the ATL Simple Object Wizard, enter a name for the class, and hit OK. The default options will do just fine, unless you're doing something fancy with your apartments. You might want to turn on IErrorInfo-support if you want to provide error messages when you return error codes from your COM methods.
Anyway, when you're done, add your two functions to the interface that was created alongside your class. You'll find it in the class view. As you add interface members through the GUI in the class view, all related files will be updated (including .idl, .h and .cpp files). Then you just fill in the blanks (which is presumably the content of your two functions).
Good music: In my rosary[^]
|
|
|
|
|
thnx jorgen
is there anything different to do if i dont have vs.net? i have vc6
|
|
|
|
|
No difference. Well, obviously the IDE menus and wizards will be different, but the concept's still the same. I'm not sure if the IDE will update all related files, if you add an interface method using a wizard though.
By the way, make sure you label your parameters with [in], [out], [out, retval], etc, where appropriately. I know VBScript will barf if you miss such a parameter attribute, and I suspect VB will too.
Good music: In my rosary[^]
|
|
|
|
|
|
ok... i hate doing this 2u but i get:
Linking...
Creating library Debug/ax2.lib and object Debug/ax2.exp
uuid.lib(cguid_i.obj) : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.
every time i try to compile the damn thing
any clue what this could mean?
"there is no spoon" biz stuff about me
|
|
|
|
|
I really don't know what's wrong. It looks though as if uuid.lib is corrupt. Have you tried replacing it from another VC6-install?
Good music: In my rosary[^]
|
|
|
|
|
u prolly dont use vc6 anymore so its irrelevant but just in case i found this and it worked ... thnx 4 the heads up
Using VC6 you may encounter the following error :
uuid.lib(unknwn_i.obj) : fatal error LNK1103: debugging information corrupt; recompile module
This error is caused by an incompatibility between the XPSP2 platform SDK and VC6.To solve this issue, use February 2003 platform SDK (and not XPSp2 Platform SDK)
DX9c October edition with extras (d3dx9.lib etc) (not december edition)
This problem can also be solved by renaming the uuid.lib file of the XPSP2 platform SDK to uuid.was_a_lib to disable it.
"there is no spoon" biz stuff about me
|
|
|
|
|
Hi
I have created the COM component. and in thati haev a one more class which is dericed from CSocket.
Ebery thing works fine , But the problemis when i connect the Client socket to server in interface from interface method. i want the value to be set . I haev created the extern variable nad have set it in Socket's receive function.
But when i call the interface method value set is different because at that time client is connected and the function scope is over and then the value is set in receive functiono Client Socket . how cani manage this
cheers
hi
|
|
|
|
|
Hello All,
Does anybody know how to find out interfaces exposed by a driver (.sys file)?
Thanks in advance
|
|
|
|
|
hi! Can anyone suggest a good project topic for DCOM, distributed processing system?
|
|
|
|
|
I have App.exe which uses Dll.dll, I also add classical Microsoft manifest file App.manifest.exe to enable XP styles for common controls.
Now question how can I disable influence of manifest on Dll.dll
Which means I want that App.exe continue to use
comctl32.dll (ver 6) new one
but
Dll.dll should use
comctl32.dll (ver 5) old one
Load / Unload library - already try not helps
#define/#undefine IE_CONTLOLS - already try doesnt helps
I need to customize body of manifest somehow include or exclude styles in the dependency section
Thanks.
|
|
|
|
|
I'm trying to add a button on the standard toolbar of IE. This button can access the HTML Object Model of web page in current IE window. To create a button on IE toolbar, I created a com object which implements IOleCommandTarget. To get access to the IHTMLDocument2, I created a com object which implements IObjectWithSite.
When there are multiple IE instances, I keep all the IObjectWithSite instances in a static ArrayList. So the IOleCommandTarget.Exec function can get access to the IHTMLDocument2 instances for each web page through this static ArrayList.
Each IE window has a added button. When the user clicks the added button in IE, I only want to access the HTML object model in the current IE window (The IE window whose button is clicked) rather than all the HTML object models in every opened IE windows. Now here comes the problem. In IOleCommandTarget.Exec function, I have no way to distinguish which IObjectWithSite instances is associated with the current IE window.
To better explain my problem, I pasted the link of the original code and article that my code tries to simulate. The original code doesn't encounter my problem because it actually process every IObjectWithSite instances through the static ArrayList.
http://www.codeguru.com/Csharp/.NET/net_general/article.php/c4671/#more[^]
I really appreciate it if anyone can point out a solution for my problem. By the way, I'm using C#.
|
|
|
|
|
Hi there,
I have a strange problem with a COM+ component that acts as an event sink for Exchange 2000 SP3.
It registers for receiving OnSyncSave notifications - but does it too well(!) It receives all messages twice - even though there only exists one registration in the SystemMailBox.
Does anybody - anybody(!) - have a clue for why this happens?
Best regards
/Michael
|
|
|
|
|
i don't quite understand the useness of it.
when should i implement this interface and when should not.
|
|
|
|
|
How do i register a component manually which is developed as simple c++ console based application in VC++.
|
|
|
|
|
I believe you are talking about a server imlemented as an EXE.\
Use following command line switches -
To Register:
/RegServer or -RegServer
To Unregister:
/UnregServer or -UnregServer
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
HELP!!! Please excuse if seeing my distress call again...
While i was building/testing an ActiveX control to be used in my MS Access form, i ACCIDENTALLY UN-Registered an existing ActiveX control.
In Access, I chose Tools | ActiveX Controls and then by accident, I Unregistered the first entry listed for me:
<br />
:-) VideoSoft FlexArray Control
After re- Registering this (C:\WINNT\System32\vsFlex3.ocx), i now get the error message:
<br />
The OLE server isn't registered.<br />
To register the OLE server, reinstall it.
and subsequent tries gives the error:
A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control. Close the OLE server and restart it outside of Microsoft Access. Then try the original operation again in Microsoft Access.
How do I reinstall the OLE server?
Reinstalling Office didn't help. This error is now associated with other ActiveX controls that used to work and not just the one I've created.
I'm using Office 2000, Premium, creating my ActiveX control in VB6 (was going ok prior to accident.)
Please help,
thanks much!
Johnny
|
|
|
|
|
hi!
ive got a problem developing an avi source filter!
the problem is that i need to read the file from disk while the file is playing in directshow! the other way is the example that shows directshow in its sample file source that comes with the sdk, but it is too slow, because it reads the full avi file in ram in the load function (from the ifilesourcefilter interface) before getting connected to the avi splitter and so on it wastes too much time! ive read that it is possible not to read the whole file and get connected succesfully to the avi splitter faking the contents of the memory buffer and reading from the file only the riff header, the avimainheader structure and the idx1 structure, but i dont know if its really true!if you please wonna confirm me the parts of the file and the structures to do it that are needed to make the avi splitter get connected i will apreciate it a lot, cause im getting frustrated with this and it doesnt go on!
thanks a lot!
villalvilla
|
|
|
|
|
Hi,
I have the following code in my DLL.
InnerClass* pInnerClass;
CComObject<cinnerclass>* pInnerC;
HRESULT hr = CComObject<cinnerclass>::CreateInstance(&pInnerC);
hr = pMyC->QueryInterface(IID_IInnerClass, reinterpret_cast
<<void**>>(&pInnerClass));
STDMETHODIMP CMyClass::get_InnerClass(IInnerClass **pVal)
{
if (pVal == NULL)
return E_POINTER;
*pVal = pInnerClass;
(*pVal)->AddRef();
return S_OK;
}
I have no problem with the code when I compile my code without Unicode, i.e. I have not problem running my DLL. But when I compile in Unicode mode, I always get the error:
Unhandled exception in Demo.exe(MyClass.DLL): 0xC0000005: Access Violation
After my debug, it seems that the line (*pVal)->AddRef(); is giving me the problem. But if the line is removed, I will have the same problem in all mode of compiling.
Please help me..
|
|
|
|
|
w_logan wrote:
(*pVal)->AddRef();
Please confirm that before the above selected code
pVal != NULL
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I need to copy data using com from one application to another.For example if card inserted in the card reader it takes the data from card and place it at the position of the cursor of the currently running application. My code to control card will be in c++ or java or vb but i want to use com to do data transfer like barcode reader driver does.
|
|
|
|
|
You can do it with SetWindowText API function. You should pass the handle of the edit you want to insert data.
It works fine!
You can also use SendMessage API.
If you have questions about using them, please ask.
|
|
|
|
|
Thanks but I don't know how to use both SetWindowText API and SendMessage API, I expect another help from you
|
|
|
|
|
Also I want to pass the handle of any edit which currently has focus.
|
|
|
|