vb.net - CreateObject not working on user machine in VB6 for tlb file created in VS .Net 2010 -
i having issue , appreciate if can make work. writing dll in .net use in vb6 project. matter every developer should able use dll in vb6 projects adding dll reference. after researching created tlb file .net using intercom option. below code tlb file,
<comclass(comclass1.classid, comclass1.interfaceid, comclass1.eventsid)> public class comclass1 #region "com guids" ' these guids provide com identity class ' , com interfaces. if change them, existing ' clients no longer able access class. public const classid string = "7b640688-3583-46bd-9a69-26f8632864e3" public const interfaceid string = "b3a59c91-fcd5-484e-83a9-24ec028e9b32" public const eventsid string = "1388246f-39c1-4b9b-bf6f-9dc3f1b75299" #end region ' creatable com class must have public sub new() ' no parameters, otherwise, class not ' registered in com registry , cannot created ' via createobject. public sub new() mybase.new() end sub public function multiplication(byval double, byval b double) dim val double val = * b return val end function end class
now in vb6 project have following code on form load
private sub form_load() dim obj classlibrary1.comclass1 set obj = new classlibrary1.comclass1 msgbox obj.multiplication(2, 4) end sub
so on machine when run vb6 project runs fine , and displays 8 correctly. on machine has vb6 installed, can correctly refer 'classlibrary1' , intellsense working fine when program runs gives error on set statement activex can't create object.
i absolutely clueless why on earth not work.
please forgive ignorance not person, appreciate if can provide me step step instruction of how resolve this.
thanks
Comments
Post a Comment