Visual Basic Interop and Upgrade ForumDiscuss how to do upgrades of VB6 code to VB.NET. Covers questions on interop features, Interop Forms Toolkit, Upgrade wizard, but NOT for questions about VB6.© 2009 Microsoft Corporation. All rights reserved.Wed, 25 Nov 2009 16:53:23 Zbf15fb7f-28a9-4ff7-842c-fb36b80f18b8http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/43d7efbf-27e7-4f47-9432-89bb1baf2571http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/43d7efbf-27e7-4f47-9432-89bb1baf2571PHL_09http://social.msdn.microsoft.com/Profile/en-US/?user=PHL_09VB6 Form_KeyPress Event Not Firing When InteropControl has Focus<p>Repro Steps:<br/><br/>- Create a new InteropControl, add a TextBox, build the control<br/>- Add the InteropControl to a VB6 Form<br/>- Set the KeyPreview property of the Form to True<br/>- Add a MsgBox or breakpoint to the Form_KeyPreview Event<br/>- Run the project, type in the InteropControl (textbox).  The KeyPreview Event is not raised.<br/>- Repeat using a VB6 TextBox.  The KeyPreview Event is raised.  <br/><br/>(This can also be tested using a VB6 menu, the shortcuts do not work when the Interop Control has the focus.  It is interesting that the accelerator keys work.)</p>Wed, 25 Nov 2009 16:53:20 Z2009-11-25T16:53:23Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/46223d8e-f4bf-4d3f-9228-bf6ab296d944http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/46223d8e-f4bf-4d3f-9228-bf6ab296d944Yannick CAPhttp://social.msdn.microsoft.com/Profile/en-US/?user=Yannick%20CAPList of Changes From VBA 6.4 to VBA 6.5First, all my appologizes if the answer already exists,<br/>but I didn't find it.<br/><br/>I have to migrate from VBA 6.4.99.69 to 6.5.10.32<br/>and I was looking for the complete list of changes<br/>brought with that 6.5 VBA version.<br/><br/>is there a &quot;Version List&quot; with all the modifications between VBA 6.4 and VBA 6.5 ?Wed, 25 Nov 2009 14:33:10 Z2009-11-25T14:33:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/80dbe13f-2273-4975-b643-b8c286132482http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/80dbe13f-2273-4975-b643-b8c286132482Joseph Pedrerohttp://social.msdn.microsoft.com/Profile/en-US/?user=Joseph%20PedreroInterop ErrorEvery time I rebuild/update the interop dll/tlb which the vb6 component is referenced to and rebuild the vb6 code, Cannot load control &lt;Control Name&gt; error occurs.<br/> <br/> Please help.<br/> <br/> Thanks.Wed, 25 Nov 2009 12:18:47 Z2009-11-25T12:18:47Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/a47b86be-91ef-43dc-a97e-cce163ab57c1http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/a47b86be-91ef-43dc-a97e-cce163ab57c1drawworkhomehttp://social.msdn.microsoft.com/Profile/en-US/?user=drawworkhomeinterop between vba and vbcan anyone point me to a good source of info?Tue, 24 Nov 2009 04:54:33 Z2009-11-25T02:35:47Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/f3d1289b-c279-4599-a0af-ee24b4653532http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/f3d1289b-c279-4599-a0af-ee24b4653532HopkinsITMhttp://social.msdn.microsoft.com/Profile/en-US/?user=HopkinsITMVB program reading Excel spreadsheet and writing to SQL DB<p>VS 2008.  I need to read an Excel Spreadsheet, search through the rows and columns, pick out data and write it to a SQL DB.  I know how to do the SQL part, but do NOT know how to do the Excel part.  I don't even know if this is the right forum.  I have read a lot but most of it is either out of date (2003 or 2005) and most of it concerns writing add-ins for Excel.  I will be running this on a machine(s) that do not even have office on them.  <br/><br/>I've found lots of &quot;detail&quot; but cannot find the overview that explains in general terms how to proceed.<br/><br/>Carl</p>Tue, 24 Nov 2009 03:57:01 Z2009-11-24T14:49:37Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/ed12e8d9-8b92-4803-bae8-56d9d75da14ahttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/ed12e8d9-8b92-4803-bae8-56d9d75da14aAzhar_Amirhttp://social.msdn.microsoft.com/Profile/en-US/?user=Azhar_AmirHow to migrate C++/ALT/COM based apps to .NetHi,<br/><br/>I need the various options and guidelines/ tools for migration of C++/ALT/COM based apps to .Net.<br/><br/>Any pointers too are appreciated<br/><br/>TIA<br/><br/>Regards<br/><br/>Azhar<hr class="sig">Thanks and Regards Azhar AmirFri, 20 Nov 2009 04:11:18 Z2009-11-24T04:01:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/3c72d215-b503-47f9-84b2-91ecc25c225bhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/3c72d215-b503-47f9-84b2-91ecc25c225be_com1http://social.msdn.microsoft.com/Profile/en-US/?user=e_com1Delete Unused Excel worksheets using VB.NET and Interop<p align=left><font face=Arial size=2>Hello,</font></p> <p align=left> </p> <p align=left>How do I delete unused/unwanted excel worksheets, such as the sheet1, sheet2, sheet3 that are created automatically? I'm using VB.NET 2005 with SQL Server 2005, and office 2007.</p> <p align=left> </p> <p align=left>Thanks!</p> <p align=left> </p>Tue, 25 Sep 2007 19:25:23 Z2009-11-24T03:52:15Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/99ca7313-2150-4caa-904d-9ab4b38e414bhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/99ca7313-2150-4caa-904d-9ab4b38e414bPianapithamhttp://social.msdn.microsoft.com/Profile/en-US/?user=PianapithamMy app with an unmanaged dll throws an AccessViolationException after update Vista sp2Hallo Everybody,<br/><br/>I am trying to use an old unmanaged dll in my VBE2008 Project. My application works fine on my computers (3 Vista sp1 and 2 XP sp3 / all with .net framwork 3.5), but after the sp2 update for 2 of Vista machines, it throws <span style="text-decoration:underline">often</span> (not every time) an AccessViolationException. The error message is:<br/>&quot;Attempt to read or write protected memory. This is often an indication that other memory is corrupt.&quot;<br/><br/>I have checked and found that the exception was thrown by the dll calling function. My code looks like this:<br/><br/> <pre lang=x-vbnet>&lt;DllImport(&quot;abc.dll&quot;, EntryPoint:=&quot;abc&quot;, _ SetLastError:=True, CharSet:=CharSet.Ansi, _ ExactSpelling:=True, llingConvention:=CallingConvention.StdCall)&gt; _ Private Shared Sub abc(ByVal input as integer) End Sub</pre> <p>The dll is in the same directory with my app and I have tried with the absolute reference like &quot;c:\abc.dll&quot;. <br/>How can i fix it? any idea?<br/><br/>thx.</p> <p>Lert Pianapitham</p>Thu, 19 Nov 2009 16:51:37 Z2009-11-24T03:51:29Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/b46443f3-aa0a-47ae-92c8-9cc962847f0fhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/b46443f3-aa0a-47ae-92c8-9cc962847f0fZERGVBhttp://social.msdn.microsoft.com/Profile/en-US/?user=ZERGVB CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(My.Settings.homepage.ToString)This gives me an error. <div><br/></div> <div> <div>Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load</div> <div>    </div> <div>        CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).Navigate(My.Settings.homepage.ToString)</div> <div><br/></div> <div>End sub</div> <div><br/></div> <div>It says that &quot;System.NullReferenceException was unhandled</div> <div>  Message=&quot;Object reference not set to an instance of an object.&quot;&quot;</div> <div><br/></div> <div>I have a value in for the setting, it is http://acedrive.tk/</div> <div><br/></div> <div> <div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;</div> <div>&lt;ArrayOfString xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;</div> <div>  &lt;string&gt;&amp;lt;http://acedrive.tk&amp;gt;&lt;/string&gt;</div> <div>&lt;/ArrayOfString&gt;</div> <div><br/></div> <div>What's the issue?</div> <div><br/></div> </div> <div><br/></div> </div>Wed, 18 Nov 2009 22:19:11 Z2009-11-25T03:35:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/2312bd31-9c42-41a6-8c7c-1ff7cd8f4f53http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/2312bd31-9c42-41a6-8c7c-1ff7cd8f4f53adhsyshttp://social.msdn.microsoft.com/Profile/en-US/?user=adhsysVS2008 Inerop Conntrol Deployment problem<p>Hi,  I am trying to deploy my VS2008 InteropControl on a WinXP-3 machine. The SetUp goes OK, But registring the control - my VB6 proj does not recognize it !!! Tryed in several ways.</p> <p>Following this article <a href="http://blogs.msdn.com/vbteam/archive/2008/03/05/interopforms-toolkit-visual-studio-2008-edition.aspx?CommentPosted=true#commentmessage">http://blogs.msdn.com/vbteam/archive/2008/03/05/interopforms-toolkit-visual-studio-2008-edition.aspx?CommentPosted=true#commentmessage</a><br/>I put a rc.exe path in the Post-Build, but for some reason got an eror on it.</p> <p>Now erasing the line does nothing, it stil is stucked there in the build proccess.</p> <p>The Ouput View follows (I have a joined setup proj.which is not shown here).</p> <p>Please your instructions how to deploy the control.</p> <p>Thanks</p> <p>adh</p> <p>--------------------------------</p> <p>------ Build started: Project: InteropControlOC_002, Configuration: Debug Any CPU ------</p> <p>@echo.</p> <p>IF EXIST &quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\..\SDK\v3.5\Bin\rc.exe&quot; (&quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\..\SDK\v3.5\Bin\rc.exe&quot; /r &quot;F:\ADHFiles\Visual Studio 2008\Projects\InteropControlOC_002\InteropUserControl.rc&quot;) ELSE (IF EXIST &quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\..\SDK\v2.0\Bin\rc.exe&quot; (&quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\..\SDK\v2.0\Bin\rc.exe&quot;/r &quot;F:\ADHFiles\Visual Studio 2008\Projects\InteropControlOC_002\InteropUserControl.rc&quot;) ELSE (IF EXIST &quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\Tools\Bin\rc.exe&quot; (&quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\Tools\Bin\rc.exe&quot;/r &quot;F:\ADHFiles\Visual Studio 2008\Projects\InteropControlOC_002\InteropUserControl.rc&quot;) ELSE (IF EXIST &quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\..\VC\Bin\rc.exe&quot; (&quot;c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\..\..\VC\Bin\rc.exe&quot;/r &quot;F:\ADHFiles\Visual Studio 2008\Projects\InteropControlOC_002\InteropUserControl.rc&quot;) ELSE (@Echo Unable to find rc.exe, using default manifest instead))))</p> <p>@echo.</p> <p>Unable to find rc.exe, using default manifest instead</p> <p>InteropControlOC_002 -&gt; F:\ADHFiles\Visual Studio 2008\Projects\InteropControlOC_002\bin\Debug\InteropControlOC_002.dll</p> <p>------ Skipped Build: Project: InteropControlOC_002_Setup, Configuration: Debug ------</p> <p>Project not selected to build for this solution configuration</p> <p>========== Build: 1 succeeded or up-to-date, 0 failed, 1 skipped ==========</p><hr class="sig">ADHTue, 03 Nov 2009 07:55:06 Z2009-11-22T07:34:05Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/9c6b627f-a5eb-4472-87c8-5161dffb9814http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/9c6b627f-a5eb-4472-87c8-5161dffb9814chriscap9916http://social.msdn.microsoft.com/Profile/en-US/?user=chriscap9916Problems with Reg-Free ComI am having some very strange errors when trying to use an isolated component.<br><br>I have a windows service that uses an interop vb6 dll.  In VS2008 I set the vb6 dll to isolated.  Visual Studio generates all the necessary manifests.  Since my service does not directly reference the com dll, it generates service.exe.manifest that contains references to other assemblies that do reference the com component.  When I go to run the service, it will only work if I register the DLL on the machine.  That is obviously not what I want to happen.   I am getting the &quot;No such interface supported&quot; just as if I hadn't registered the component.  I can't use sxstrace.exe since I am on XP and server 2003.<br><br>I created a small testing application that referenced the isolated dll directly instead of through other assemblies.  All I did was instantiate one of the classes, but this didn't fail as it did earlier with the services.  I compared the manifests generated by my test app and the service I am working on.  They are identical except for assembly name.  <br><br>Does anyone know why this might be happening?  Is there anyway to debug to find out what's happening.  I don't want to have to register the component on the production server.<br><br>I've read all the forum posts and articles I could find.  There's no errors in the event log regarding the side by side activation like I've been told there should be.  Did I forget to install something?  The production machine as .net framework 3.5.  <br><br>Here is the manifest for the service<br><br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">&lt;?</font><font style="font-size:11px">xml </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">encoding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;utf-8&quot;</font><font style="font-size:11px">?&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">&lt;</font><font style="font-size:11px">assembly xsi:</font><font style="color:red">schemaLocation</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd&quot;</font><font style="font-size:11px"> </font><font style="color:red">manifestVersion</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">asmv1</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v1&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">asmv2</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v2&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">asmv3</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v3&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">dsig</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">co.v1</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:clickonce.v1&quot;</font><font style="font-size:11px"> </font><font style="color:red">xmlns</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v1&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">xsi</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td>  <font style="color:blue">&lt;</font><font style="font-size:11px">assemblyIdentity </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Service.exe&quot;</font><font style="font-size:11px"> </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0.0.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">type</font><font style="font-size:11px">=</font><font style="color:blue">&quot;win32&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">  <font style="color:blue">&lt;</font><font style="font-size:11px">dependency</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>    <font style="color:blue">&lt;</font><font style="font-size:11px">dependentAssembly asmv2:</font><font style="color:red">dependencyType</font><font style="font-size:11px">=</font><font style="color:blue">&quot;install&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">codebase</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.ServiceLibrary.manifest&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">size</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1951&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">      <font style="color:blue">&lt;</font><font style="font-size:11px">assemblyIdentity </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.ServiceLibrary&quot;</font><font style="font-size:11px"> </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0.0.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">type</font><font style="font-size:11px">=</font><font style="color:blue">&quot;win32&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;</font><font style="font-size:11px">hash </font><font style="color:red">xmlns</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v2&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>          <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transform </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestMethod </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px">9R6hxcgGtK3vOvbE5xBL/I+</font><font style="color:red">dCs8</font><font style="font-size:11px">=</font><font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;/</font><font style="font-size:11px">hash</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">&lt;/</font><font style="font-size:11px">dependentAssembly</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>  <font style="color:blue">&lt;/</font><font style="font-size:11px">dependency</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">  <font style="color:blue">&lt;</font><font style="font-size:11px">dependency</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>    <font style="color:blue">&lt;</font><font style="font-size:11px">dependentAssembly asmv2:</font><font style="color:red">dependencyType</font><font style="font-size:11px">=</font><font style="color:blue">&quot;install&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">codebase</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.BusinessObject.manifest&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">size</font><font style="font-size:11px">=</font><font style="color:blue">&quot;8826&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">      <font style="color:blue">&lt;</font><font style="font-size:11px">assemblyIdentity </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.BusinessObject&quot;</font><font style="font-size:11px"> </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0.0.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">type</font><font style="font-size:11px">=</font><font style="color:blue">&quot;win32&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;</font><font style="font-size:11px">hash </font><font style="color:red">xmlns</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v2&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>          <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transform </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestMethod </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px">IUjtYMgEeil/</font><font style="color:red">9uUl9Dy7KphlgDM</font><font style="font-size:11px">=</font><font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;/</font><font style="font-size:11px">hash</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">&lt;/</font><font style="font-size:11px">dependentAssembly</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>  <font style="color:blue">&lt;/</font><font style="font-size:11px">dependency</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">  <font style="color:blue">&lt;</font><font style="font-size:11px">dependency</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>    <font style="color:blue">&lt;</font><font style="font-size:11px">dependentAssembly asmv2:</font><font style="color:red">dependencyType</font><font style="font-size:11px">=</font><font style="color:blue">&quot;install&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">codebase</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.WebService.manifest&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">size</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1278&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">      <font style="color:blue">&lt;</font><font style="font-size:11px">assemblyIdentity </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.WebService&quot;</font><font style="font-size:11px"> </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0.0.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">type</font><font style="font-size:11px">=</font><font style="color:blue">&quot;win32&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;</font><font style="font-size:11px">hash </font><font style="color:red">xmlns</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v2&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>          <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transform </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestMethod </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px">HjdAo0XQ1iOtzpDVk6XERI3D1Gg=</font><font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;/</font><font style="font-size:11px">hash</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">&lt;/</font><font style="font-size:11px">dependentAssembly</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>  <font style="color:blue">&lt;/</font><font style="font-size:11px">dependency</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">&lt;/</font><font style="font-size:11px">assembly</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr></tbody></table></div><br>And here is the manifest of the assembly that actually contains the reference of the COM component.  This is IDENTICAL save assembly name to my little test app that worked<br><br><div style="overflow:auto;background-color:white;line-height:100% ! important;font-family:Courier New;font-size:11px"><table style="border-width:0px;margin:2px 0px;width:99%;border-collapse:collapse;background-color:rgb(255, 255, 255)" cellpadding=0 cellspacing=0><col style="font-family:Courier New;font-size:11px;padding-left:10px;white-space:nowrap"><tbody><tr><td><font style="font-size:11px"></font><font style="color:blue">&lt;?</font><font style="font-size:11px">xml </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">encoding</font><font style="font-size:11px">=</font><font style="color:blue">&quot;utf-8&quot;</font><font style="font-size:11px">?&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">&lt;</font><font style="font-size:11px">assembly xsi:</font><font style="color:red">schemaLocation</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd&quot;</font><font style="font-size:11px"> </font><font style="color:red">manifestVersion</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">asmv1</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v1&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">asmv2</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v2&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">asmv3</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v3&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">dsig</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2000/09/xmldsig#&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">co.v1</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:clickonce.v1&quot;</font><font style="font-size:11px"> </font><font style="color:red">xmlns</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v1&quot;</font><font style="font-size:11px"> xmlns:</font><font style="color:red">xsi</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td>  <font style="color:blue">&lt;</font><font style="font-size:11px">assemblyIdentity </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;Native.BusinessObject&quot;</font><font style="font-size:11px"> </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0.0.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">type</font><font style="font-size:11px">=</font><font style="color:blue">&quot;win32&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">  <font style="color:blue">&lt;</font><font style="font-size:11px">file </font><font style="color:red">name</font><font style="font-size:11px">=</font><font style="color:blue">&quot;vb6Component.dll&quot;</font><font style="font-size:11px"> asmv2:</font><font style="color:red">size</font><font style="font-size:11px">=</font><font style="color:blue">&quot;9900032&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td>    <font style="color:blue">&lt;</font><font style="font-size:11px">hash </font><font style="color:red">xmlns</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:asm.v2&quot;</font><font style="font-size:11px">&gt; </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">      <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>        <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:Transform </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;urn:schemas-microsoft-com:HashTransforms.Identity&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">      <font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:Transforms</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>      <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestMethod </font><font style="color:red">Algorithm</font><font style="font-size:11px">=</font><font style="color:blue">&quot;http://www.w3.org/2000/09/xmldsig#sha1&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">      <font style="color:blue">&lt;</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px">ImxPXo252XIWm9uMe3jJTyWRKmQ=</font><font style="color:blue">&lt;/</font><font style="font-size:11px">dsig:DigestValue</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>    <font style="color:blue">&lt;/</font><font style="font-size:11px">hash</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">&lt;</font><font style="font-size:11px">typelib </font><font style="color:red">tlbid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;{4df18f65-5af1-40f0-b10b-45ac3d330567}&quot;</font><font style="font-size:11px"> </font><font style="color:red">version</font><font style="font-size:11px">=</font><font style="color:blue">&quot;1.0&quot;</font><font style="font-size:11px"> </font><font style="color:red">helpdir</font><font style="font-size:11px">=</font><font style="color:blue">&quot;&quot;</font><font style="font-size:11px"> </font><font style="color:red">resourceid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;0&quot;</font><font style="font-size:11px"> </font><font style="color:red">flags</font><font style="font-size:11px">=</font><font style="color:blue">&quot;HASDISKIMAGE&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>    <font style="color:blue">&lt;</font><font style="font-size:11px">comClass </font><font style="color:red">clsid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;{4770821c-caee-4c4a-8234-6d43b2072c08}&quot;</font><font style="font-size:11px"> </font><font style="color:red">tlbid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;{4df18f65-5af1-40f0-b10b-45ac3d330567}&quot;</font><font style="font-size:11px"> </font><font style="color:red">progid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;class1&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)">    <font style="color:blue">&lt;</font><font style="font-size:11px">comClass </font><font style="color:red">clsid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;{2e37ea2c-ee70-4698-a562-4ec7bf1f408c}&quot;</font><font style="font-size:11px"> </font><font style="color:red">tlbid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;{4df18f65-5af1-40f0-b10b-45ac3d330567}&quot;</font><font style="font-size:11px"> </font><font style="color:red">progid</font><font style="font-size:11px">=</font><font style="color:blue">&quot;class2&quot;</font><font style="font-size:11px"> </font><font style="color:blue">/&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td>  <font style="color:blue">&lt;/</font><font style="font-size:11px">file</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr><tr><td style="background-color:rgb(247, 247, 247)"><font style="color:blue">&lt;/</font><font style="font-size:11px">assembly</font><font style="color:blue">&gt;</font><font style="font-size:11px"> </font></td></tr></tbody></table></div><br>I have changed the name of the assemblies and removed some of the classes for brevity.  And just for reference, the windows service calls the ServiceLibrary assembly which calls the WebService assembly which callse the BusinessObject assembly which calls the vb6 COM component.  The WebService assembly is not actually a web service, it's just a regular .net assembly that was named poorly.<br><br>Thanks<br> Wed, 30 Jul 2008 17:38:42 Z2009-11-20T20:24:15Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/659b0ef3-c225-4967-890c-285ddb58dc3fhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/659b0ef3-c225-4967-890c-285ddb58dc3fJoe Cletcherhttp://social.msdn.microsoft.com/Profile/en-US/?user=Joe%20Cletcher3rd Party Excel Menu Item ExecutionI'm using Visual Studio 2008 Profession and programming in Visual Basic. I have a 2003 Excel Spreadsheet provided by a 3rd party with a menu item (one level down) that when clicked generates a bunch of cells with SQL script based on information on other cells.<br/><br/>I've written code that does some error checking, correction of errors, and insertion of missing items by comparing a previous version with the current version of the spreadsheet. After all that is done I would like to execute the 3rd party menu item from within my Visual Basic code. Is there a way to do this?Thu, 12 Nov 2009 15:14:38 Z2009-11-20T15:42:10Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/df9b9dc4-fa5b-4ad0-b2f9-b9a837e6ce91http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/df9b9dc4-fa5b-4ad0-b2f9-b9a837e6ce91DeepMaroonhttp://social.msdn.microsoft.com/Profile/en-US/?user=DeepMaroonInteracting with .Net FormsCan a vb6 project &quot;see&quot; a .net form?  <br/> <br/> In vb6 I've add this code to call a vb9 form (DBLocForm - which sets the My.Settings connection string for typed datasets):<br/> <br/>     Private Sub DBLocactionClick_Click()<br/>         On Error Resume Next<br/>         Me.Hide()<br/>         Unload(Me)<br/>         DBPathTimer.enabled = True<br/>         DBPathBoolean = True<br/>         DBLocForm.SHOW()<br/>     End Sub<br/> <br/>     Private Sub DBPathTimer_Timer()<br/>         If DBPathBoolean = True Then<br/>             Dim frm As Form<br/>             For Each frm In Forms<br/>                 If frm.Name = &quot;DBLocForm&quot; Then<br/>                     Exit For<br/>                 Else<br/>                     Second = Second + 1<br/>                     If Second &gt; 2 Then<br/>                         Call Form_Load()<br/>                         Me.Visible = True<br/>                         DBPathBoolean = False<br/>                         DBPathTimer.enabled = False<br/>                     End If<br/>                 End If<br/>             Next<br/>         End If<br/>     End Sub<br/> <br/> This seems to work in debug but fails miserably in a live version.  What are my options?Tue, 10 Nov 2009 00:56:56 Z2009-11-20T06:18:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/780e781e-072e-49ff-bf8a-fc3beb742ba8http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/780e781e-072e-49ff-bf8a-fc3beb742ba8HomeBunnyhttp://social.msdn.microsoft.com/Profile/en-US/?user=HomeBunnyUnexpected exception occurred during upgrade engine operation<p>Hi,</p> <p>During a every conversion of a 'VB6 project' to 'VB 2005 Express', I'm always getting folowing error:</p> <p>---------------------------<br>Visual Basic Upgrade Wizard error<br>---------------------------<br>Unexpected exception occurred during upgrade engine operation: Kan niet aan de bron binden (Exception from HRESULT: 0x8004000A (OLE_E_CANT_BINDTOSOURCE))<br>---------------------------<br>OK   <br>---------------------------</p> <p><u>My System</u>: Windows 2000 SP4 (Clean Install) - Visual Basic 2005 Express ed.</p> <p> </p> <p>Any ideas howto resolve this?</p> <p>Thx.</p>Tue, 22 Aug 2006 08:52:46 Z2009-11-19T16:24:11Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/bb7ac101-2248-4f75-8b41-dbd2e4760ef2http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/bb7ac101-2248-4f75-8b41-dbd2e4760ef2Donald Campbellhttp://social.msdn.microsoft.com/Profile/en-US/?user=Donald%20Campbellpivotwizard fails with Office 2003I am calling Excel to hold a series of database data and then create a pivot <br/>table from it (VB from Visual studio 2008 using office interop). Works fine <br/>on my development and test boxes  (both have Office 2007). The target system <br/>has Office 2003 and fails on the pivot table wizard.<br/><br/>        'Create a Pivot Table - CAUSES an ERROR with Excel 2003 !<br/>        xlSheet2 = xlBook.Sheets(&quot;Sheet2&quot;)<br/>        xlSheet2.Name = &quot;PivotTable&quot;<br/><br/>        Dim pivotTable As PivotTable = Nothing<br/>        Dim CourseList As PivotField = Nothing<br/>        Dim NatList As PivotField = Nothing<br/>        Dim NatSum As PivotField = Nothing<br/>        Dim pivotTableName As String = &quot;Nationality Analsys&quot;<br/><br/>        ' Add a pivot table to the worksheet.<br/>        Dim EndCell As String = &quot;C&quot; + RowNo.ToString<br/>        xlBook.PivotTableWizard(XlPivotTableSourceType.xlDatabase, _<br/>            xlSheet.Range(&quot;A1&quot;, EndCell), xlSheet2.Range(&quot;A1&quot;), <br/>pivotTableName, True, True, _<br/>            True, True, , , False, False, XlOrder.xlDownThenOver, 0)<br/><br/>        ' Set variables for used to manipulate the Pivot Table.<br/>        pivotTable = xlSheet2.PivotTables(pivotTableName)<br/>        CourseList = pivotTable.PivotFields(1)<br/>        NatList = pivotTable.PivotFields(2)<br/>        NatSum = pivotTable.PivotFields(3)<br/><br/>         Format the Pivot Table.<br/>        'pivotTable.Format(XlPivotFormatType.xlReport2)<br/>        pivotTable.InGridDropZones = False<br/><br/>        ' Set  a Row Field.<br/>        CourseList.Orientation = XlPivotFieldOrientation.xlColumnField<br/>        NatList.Orientation = XlPivotFieldOrientation.xlRowField<br/>        NatSum.Orientation = XlPivotFieldOrientation.xlDataField<br/><br/>        ' Set  a Value Field.<br/>        NatSum.Orientation = XlPivotFieldOrientation.xlDataField<br/>        NatSum.Function = XlConsolidationFunction.xlSum<br/><br/><br/>-------<br/><br/>So it seems that Excel 2003 does not have the pivotwizard. The question is <br/>what can I use instead and what would work on both Office 2003 and 2008?<br/><br/><hr class="sig">Don CWed, 18 Nov 2009 09:23:31 Z2009-11-20T10:24:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6eaf4dd7-90c7-491b-9cf5-451493552836http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6eaf4dd7-90c7-491b-9cf5-451493552836blachogihttp://social.msdn.microsoft.com/Profile/en-US/?user=blachogihandle a .net Com Class event in vb6 - not works i have the ComClassSearchCustomers class  and interface IComClassSearchCustomersat .net which used to create a tlb file. The class raise an event inside new. After that i have a vb6 form Form1 which catch the event , but it never see the event. Any ideas? <br/> <pre lang=x-vbnet>Option Strict On Option Explicit On Imports System.Runtime.InteropServices &lt;Guid(&quot;BB86EB1C-6444-424f-B83B-A667561E06C3&quot;), _ ComSourceInterfaces(GetType(IComClassSearchCustomers))&gt; _ Public Class ComClassSearchCustomers Public Delegate Sub printReportEventHandler(ByVal codes As String) Public Event printReport As printReportEventHandler Public Sub New() MyBase.New() RaiseEvent printReport End Sub End Class Imports System.Runtime.InteropServices &lt;Guid(&quot;D8F7EC74-0EFC-4e43-9B59-4CF741DF616D&quot;), _ InterfaceType(ComInterfaceType.InterfaceIsIDispatch)&gt; _ Public Interface IComClassSearchCustomers &lt;DispId(1)&gt; _ Sub printReport(ByVal codes As String) End Interface</pre> <span style="color:#0000ff;font-size:x-small"> <pre>Public WithEvents Instance As Search.ComClassSearchCustomers Private Sub Form_Load() Set Instance = New Search.ComClassSearchCustomers End Sub Private Sub Instance_printReport(ByVal codes As String) MsgBox (&quot;raise&quot;) End Sub</pre> </span>Fri, 13 Nov 2009 09:17:11 Z2009-11-19T09:56:55Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/14cdc473-ceb5-475a-8a7b-5c7456266cd7http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/14cdc473-ceb5-475a-8a7b-5c7456266cd7Skip Christensenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Skip%20ChristensenVisual Basic 2008 - change font in a created Word documentI'm writing a program that will read from an Excel spreadsheet - reading state names and cities in the state.  I want to write to the Word document.  I know how to create a Word document in VB8, but I can't figure out how to change fonts.  For example, I want to create a list with the state name in a large font, then change the font and list the city names.  Then when I encounter another state I increase the font.<br/><br/>Maine             'I want to make this a size 16 font<br/>Bar Harbor     'The city names would be a size 10 font<br/>Bangor<br/>Michigan        'Now back to a size 16 font<br/>Ann Arbor     ' Size 10 font for the city names<br/>Lansing<br/><br/>Is it possible to flip-flop font size and if so can you give me an idea.Thu, 12 Nov 2009 18:11:22 Z2009-11-19T09:30:32Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/ed8bb50f-8bb1-458b-8de6-607364019175http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/ed8bb50f-8bb1-458b-8de6-607364019175mpdillon56http://social.msdn.microsoft.com/Profile/en-US/?user=mpdillon56How to create a dll that can be referenced in VBA or vb6<p>I am trying to create a Com Class dll in <acronym title="Visual Basic">VB</acronym>.Net 2008 which will be accessable from VBA and VB6.<br/><br/>I have choosen Class Library.<br/>Then added a New COM Class<br/>I deleted the original Class1 .<acronym title="Visual Basic">vb</acronym><br/><br/>I added my code.<br/>I added &lt;Assembly: ClassInterface(ClassInterfaceType.AutoDual)&gt; to my Com Class. It already had a ComClass entry<br/>I made sure &quot;Register for COM interopp&quot; was checked in the project&gt;properties&gt;Compile screen.<br/><br/>After a build I move the .dll, .tlb and the snk to a server.<br/><br/>I would like to leave the dll on the server rather than install it on every workstation (but I could put it on every workstation if that is my problem).<br/>Since I am also testing on the server I use RegAsm to register the assembly.<br/><br/>I have tried both <br/><br/>regasm M:\email\sendemail.dll /codebase M:\email\sendemail.dll<br/>and <br/><br/>regasm M:\email\sendemail.dll /tlb:M:\email\sendemail.tlb /codebase M:\email\sendemail.dll<br/><br/>The second one overwrites the .tlb created by visual studio.<br/><br/>I even dragged the .dll into the C:\windows\assembly directory and unregistered the assembly.<br/><br/>Regardless of what I have tried, I cannot add the dll as a reference in Excel 2003.<br/><br/>The message I receive is:<br/>&quot;Can't add a refernce to the specied file&quot;<br/><br/>I can add the .tld file. When I add the .tlb file I can see the properties and methods. But when I run the code I get ActiveX component cannot create object. (this is the error message I get when using the VS version of the.tlb. The message is different when I use the .tlb which is generated by the RegAsm.)<br/><br/>I have read many many google results but still nothing that has gotten me going.<br/><br/>It can't be this difficult. What am I missing???<br/><br/>thanks,<br/>pat<br/><br/>Here is the code. I have removed all of the properties except for one and I have stripped everything out of the method, except the one line. I hope this helps.<br/><br/>Imports System.Net<br/>Imports System.Net.Mail<br/>Imports System.Runtime.InteropServices<br/>'<br/>&lt;Assembly: ClassInterface(ClassInterfaceType.AutoDual)&gt; <br/>&lt;ComClass(SendEmailClass.ClassId, SendEmailClass.InterfaceId, SendEmailClass.EventsId)&gt; _<br/>'<br/>Public Class SendEmailClass<br/>'<br/>#Region &quot;COM GUIDs&quot;<br/>    ' These  GUIDs provide the COM identity for this class <br/>    ' and its COM interfaces. If you change them, existing <br/>    ' clients will no longer be able to access the class.<br/>    Public Const ClassId As String = &quot;187d8992-b211-44f7-9bf0-9be98129905c&quot;<br/>    Public Const InterfaceId As String = &quot;2ca24656-528b-42a2-bed0-a1452d70c0de&quot;<br/>    Public Const EventsId As String = &quot;e8f8d4e7-ee4d-47e8-8b30-765111c27ec0&quot;<br/>#End Region<br/>'<br/>    ' A creatable COM class must have a Public Sub New() <br/>    ' with no parameters, otherwise, the class will not be <br/>    ' registered in the COM registry and cannot be created <br/>    ' via CreateObject.<br/>    Public Sub New()<br/>        MyBase.New()<br/>    End Sub<br/>'<br/>    Private ToStringM As String<br/>'<br/>    Public Property ToAddressString() As String<br/>        Get<br/>            Return ToStringM<br/>        End Get<br/>        Set(ByVal Value As String)<br/>            ToStringM = Value<br/>        End Set<br/>    End Property</p> <p>    Public Sub SendMail()<br/>        Dim mail As New Mail.MailMessage<br/>        mail.To.Add(ToStringM)</p> <p>    End Sub<br/>End Class</p>Sun, 15 Nov 2009 20:57:27 Z2009-11-20T10:25:23Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/3c867e0e-969f-49ce-a34c-57d96fa834abhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/3c867e0e-969f-49ce-a34c-57d96fa834abJ Maynardhttp://social.msdn.microsoft.com/Profile/en-US/?user=J%20MaynardIsDate function migration issueOur application was recently migrated from VB 6.0 to VB .NET.  I am having an issue with the IsDate function working differently in .NET.  I found references that indicate that there is a IsDate6 function that works the same as the VB 6 function.  I would appreciate it if someone could tell me where to find this function or what should replace it?Fri, 13 Nov 2009 20:09:32 Z2009-11-19T09:27:00Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/647875c8-7936-428e-aff9-af1153fef6a5http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/647875c8-7936-428e-aff9-af1153fef6a5Ashkarmehttp://social.msdn.microsoft.com/Profile/en-US/?user=AshkarmeRun Time errorHI! am ashkar ... <div>   i hve a problem in my computer ..when i open &quot;my computer&quot; or &quot;My documents&quot; in desktop shortcuts or start menu program it doesn't shows the dialog box..but it shows a &quot;winbug&quot; box and shows a messege like below,</div> <div><strong>{ run-time error'-2147024894(80070002)':</strong></div> <div><strong>Invalid root in registry key&quot;HKCU\SOFTWARE\Microsoft\...}</strong></div> <div><br/></div> <div>Hope you all can understand my Question..Am waiting for reply ..</div> <div><br/></div> <div>Advance thanks.!</div> <div><br/></div> <div>  </div>Thu, 12 Nov 2009 03:14:36 Z2009-11-18T06:54:27Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6736901a-740c-4661-a646-3a9fd9aaf8f1http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6736901a-740c-4661-a646-3a9fd9aaf8f1Hollandtechhttp://social.msdn.microsoft.com/Profile/en-US/?user=HollandtechVB 2008 Can't see some properties of VB 6 OCXsI have a large library of graphical control OCXs created under VB 6.  I can import them into VB 2008 projects and for the most part they work perfectly except that some properties are not seen by VB 2008.  For example, the &quot;caption&quot; property of one control works fine while the same property of another control is invisible to VB 2008.  These properties not only do not show up in the Solution explorer, but they cannot be referenced in a program or an error occurs.  For the most part they are string properties such as &quot;Caption&quot;, &quot;FilePath&quot;, &quot;Password 1&quot;, etc.  I tried renaming them to less common names with ne effect.  I even tried recompiling the objects in VB6 with most the other properties eliminated and they still do not show up.<br/> <br/> Is there any way of getting these to work without going through a full translation?Thu, 12 Nov 2009 07:10:48 Z2009-11-19T09:57:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/d1b3d74c-4f9e-4005-a60b-5b1d44443cd4http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/d1b3d74c-4f9e-4005-a60b-5b1d44443cd4Neonhttp://social.msdn.microsoft.com/Profile/en-US/?user=NeonC#.net user control in VB6<p>I have created a simple usercontrol in c# . It consist of three textboxes.</p> <p>I have written a method in usercontrol to set the values in these textboxes</p><font color="#0000ff" size=2> <p>public</font><font size=2> </font><font color="#0000ff" size=2>partial</font><font size=2> </font><font color="#0000ff" size=2>class</font><font size=2> </font><font color="#008080" size=2>Win</font><font size=2> : </font><font color="#008080" size=2>UserControl</p></font><font size=2> <p>{</p> <p></font><font color="#0000ff" size=2>public</font><font size=2> Win()</p> <p>{</p> <p>InitializeComponent();</p> <p>}</p> <p></font><font color="#0000ff" size=2>private</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> button1_Click(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#008080" size=2>EventArgs</font><font size=2> e)</p> <p>{</p> <p>textBox3.Text = textBox1.Text + textBox2.Text;</p> <p>}</p> <p></font><font color="#0000ff" size=2>public</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> CalVal()</p> <p>{</p> <p>textBox1.Text = </font><font color="#800000" size=2>&quot;My&quot;</font><font size=2>;</p> <p>textBox2.Text = </font><font color="#800000" size=2>&quot;Name&quot;</font><font size=2>;</p> <p>textBox3.Text = </font><font color="#800000" size=2>&quot;Neeraj&quot;</font><font size=2>;</p> <p>}</p> <p>}</p> <p> </p> <p>It is successfully registered as COM component .</p> <p>When i use it in VB6 i am not able to set the values in these textboxes</p> <p> </p> <p>Dim objControlNew As Try.Win</p> <p> </p> <p>Private Sub Command2_Click()</font></p> <p><font size=2>  Dim str As String<br>    Dim strnew As String</font></p> <p><font size=2>  Set objControlNew = New Try.Win</font></p> <p><font size=2>  Me.Controls.Add objControlNew, &quot;dotnet&quot;<br>    Me.Controls(&quot;dotnet&quot;).Visible = True<br>    objControlNew.CalVal<br>  End Sub</font></p> <p> </p> <p>I am just calling the method , values are set from usercontrol , but i am not able to see the values in the textboxes. </p> <p>Please help if anyone know the solution</p>Fri, 01 Jun 2007 06:32:55 Z2009-11-17T15:09:58Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/ae6d2a64-7f14-4f06-952d-073eee8c3b2dhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/ae6d2a64-7f14-4f06-952d-073eee8c3b2dJohnFLhttp://social.msdn.microsoft.com/Profile/en-US/?user=JohnFLVB6 Code To VB.NETCan someone please help me converting this code from VB6 To VB.NET?<br/><br/> <pre lang=x-vbnet>Private Sub cmdCreateLog_Click() Dim lngLocation As Long Dim strLine As String Open &quot;c:\test.pdf&quot; For Binary As #1 ' Open file just created. Open &quot;c:\pdfTest.txt&quot; For Output As #2 Do While lngLocation &lt; LOF(1) ' Loop until end of file. strLine = Input(1, #1) ' Read character into variable. lngLocation = Loc(1) ' Get current position within file. Print #2, lngLocation &amp; &quot; &quot; &amp; Replace(Replace(strLine, vbLf, &quot;line feed&quot;), vbCr, &quot;carriage return&quot;) &amp; vbCrLf; Loop Close #1 ' Close file. Close #2 End End Sub </pre> <br/><br/><hr class="sig">JohnMon, 09 Nov 2009 21:30:18 Z2009-11-16T15:33:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/90313c5a-45f8-4087-99e1-8db1fa256c40http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/90313c5a-45f8-4087-99e1-8db1fa256c40adhsyshttp://social.msdn.microsoft.com/Profile/en-US/?user=adhsysSending an Open Connection to the Interop Control ??In my Introp Control I need to get data from My SQL Database.<br/>It is a too big wait (much more than in the VB6 prg!).<br/>Could I send to the iCtrl an already open SQL.Connection?<br/>(I tried, but failed ?!)<br/>Thanks<br/><hr class="sig">ADHSun, 08 Nov 2009 18:00:41 Z2009-11-18T06:09:50Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/90cf174c-0606-4918-8ee1-4e1c44ad491bhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/90cf174c-0606-4918-8ee1-4e1c44ad491bFeraudhttp://social.msdn.microsoft.com/Profile/en-US/?user=FeraudNo members available when using .NET assembly in Excel VBAHello, <div><br/></div> <div>I created a .Net-DLL including a class which I wanted to use in Excel-VBA. I can reference the .tlb-file in VBA and create a new instance of the class. But I can neither access any members of it nor do I see any properties or methods of the class in the vba-object explorer.</div> <div><br/></div> <div>Here is what I have done:</div> <div><br/></div> <div>1. Written a simple test-class in VB.Net:</div> <div> </div> <div> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">Imports</span> System.Runtime.InteropServices <span style="color:Blue">Public</span> <span style="color:Blue">Class</span> clsPerson <span style="color:Blue">Private</span> _name <span style="color:Blue">As</span> <span style="color:Blue">String</span> <span style="color:Blue">Private</span> _age <span style="color:Blue">As</span> <span style="color:Blue">Integer</span> <span style="color:Green">'Needed for COM-interoperability</span> <span style="color:Blue">Public</span> <span style="color:Blue">Sub</span> <span style="color:Blue">New</span>() <span style="color:Blue">End</span> <span style="color:Blue">Sub</span> &lt;ComVisible(<span style="color:Blue">True</span>)&gt; <span style="color:Blue">Public</span> <span style="color:Blue">Property</span> Name() <span style="color:Blue">As</span> <span style="color:Blue">String</span> <span style="color:Blue">Get</span> Name = _name <span style="color:Blue">End</span> <span style="color:Blue">Get</span> <span style="color:Blue">Set</span>(<span style="color:Blue">ByVal</span> value <span style="color:Blue">As</span> <span style="color:Blue">String</span>) _name = Name <span style="color:Blue">End</span> <span style="color:Blue">Set</span> <span style="color:Blue">End</span> <span style="color:Blue">Property</span> &lt;ComVisible(<span style="color:Blue">True</span>)&gt; <span style="color:Blue">Public</span> <span style="color:Blue">Property</span> Age() <span style="color:Blue">As</span> <span style="color:Blue">Integer</span> <span style="color:Blue">Get</span> Age = _age <span style="color:Blue">End</span> <span style="color:Blue">Get</span> <span style="color:Blue">Set</span>(<span style="color:Blue">ByVal</span> value <span style="color:Blue">As</span> <span style="color:Blue">Integer</span>) _age = value <span style="color:Blue">End</span> <span style="color:Blue">Set</span> <span style="color:Blue">End</span> <span style="color:Blue">Property</span> <span style="color:Blue">Public</span> <span style="color:Blue">Function</span> Description() <span style="color:Blue">As</span> <span style="color:Blue">String</span> <span style="color:Blue">Return</span> <span style="color:Blue">Me</span>.Name &amp; <span style="color:#A31515">&quot; ist &quot;</span> &amp; <span style="color:Blue">Me</span>.Age &amp; <span style="color:#A31515">&quot; Jahre alt.&quot;</span> <span style="color:Blue">End</span> <span style="color:Blue">Function</span> <span style="color:Blue">End</span> <span style="color:Blue">Class</span> </pre> </div> 2. Checked &quot;Make the Assembly visible to COM&quot; in the Assembyinformation-popup-window of the project-properties..</div> <div><br/></div> <div>3. Checked &quot;Register for COM-Interop&quot;  in the compile-settings of the project-properties.</div> <div><br/></div> <div>4. Built the project somewhere.</div> <div><br/></div> <div>5. In Excel-VBA-Editor edited a reference to the newly built .tlb-file.</div> <div><br/></div> <div>6. Wrote following test-code in VBA</div> <div><br/></div> <div> <div style="color:Black;background-color:White"> <pre><span style="color:Blue">Sub</span> Test() <span style="color:Blue">Dim</span> p <span style="color:Blue">As</span> <span style="color:Blue">New</span> clsPerson p.Name = <span style="color:#A31515">&quot;f&quot;</span> <span style="color:Blue">End</span> <span style="color:Blue">Sub</span> </pre> </div> The  clsPerson-Instance gets created, but the line p.Name throws an automation error.</div> <div><br/></div> <div>Any idea what goes wrong? Any ideas are welcome.</div> <div><br/></div> <div>Thx a lot for your help!</div> <div><br/></div> <div>P.S.: Just got the VBA-Editor to show the members by setting the &quot;COM-class&quot;-Property the .NET-Class in Visual Studio to &quot;True&quot;. Anyway, an automation-error is still thrown when trying to set a value, eg. for the age-property of the person-class in vba.</div>Sat, 14 Nov 2009 12:54:16 Z2009-11-15T14:18:21Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/92c6978e-b250-4308-865d-3fc6f7d8c73ahttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/92c6978e-b250-4308-865d-3fc6f7d8c73ayjeevanraohttp://social.msdn.microsoft.com/Profile/en-US/?user=yjeevanraoActivex ControlHi all,<br/> <br/>      I am implementing vb.net application to monitor internet accessing.  When user click on any browser it should prompt to login page.  After entering the credentials it should allow user to access inter net. This is very urgent please response to this. <br/> <br/> Regards,<br/> <br/> Y.JeevanRaoMon, 09 Nov 2009 16:47:58 Z2009-11-14T06:54:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/fec266fb-7a00-4700-9100-2349b772308ehttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/fec266fb-7a00-4700-9100-2349b772308ePHL_09http://social.msdn.microsoft.com/Profile/en-US/?user=PHL_09Increasing Memory Usage with Interop Controls in ActiveXControls<p>Using an interop control inside a VB6 ActiveX Control results in ever-increasing memory use as the form is loaded and unloaded.  This is part of a complex upgrade of a larger app with many forms and controls.  We cannot simply eliminate the ActiveX controls in a single step.  <br/><br/>What seems to be happening is that the OCX remains loaded until the VB6 app ends.  The Terminate Event in the ActiveX control does not fire when the form is unloaded.  If the Interop control in the ActiveX control is replaced with a VB control, i.e. TextBox, the Terminate Event is fired.<br/><br/>I have sample code to repro, not sure how to upload it here.<br/><br/>Any help or suggestions would be greatly appreciated.  Thanks.<br/><br/><strong>Prove that memory use with the stand-alone interop control is ok<br/></strong>    a) In VB.Net, create an interop control, drop a textbox on the control, name the control InteropTextBox1 and build it<br/>    b) Place InteropTextBox1 on a VB6 form.  Add code to load/unload the form in a loop for 500-1000 iterations.<br/>    c) Build and run the VB6 app.  In task manager, note the memory used is constant or grows only slightly<br/><br/><strong>Observe the memory use increases with an ActiveX Control.<br/></strong>    a) Place InteropTextBox1 on a VB6 ActiveX control<br/>    b) Add the ActiveX control to the VB6 form from step 1-b above, (replace InteropTextBox1 on the form)<br/>    c) Build and run the VB6 app.  in task manager, note the memory used steadily increases until VB6 freezes with an out of memory error.<br/><br/><strong>Show that the Terminate Event Does not Fire when there is an Interop Control in the ActiveX control<br/></strong>    a) Add a message box in the UserControl_Terminate Event of the ActiveX control<br/>    b) Add another form to the VB6 app, Form2.  Set Form2 as the Startup Object.  Add a CommandButton to Form 2.  In the Command1_Click Event, add the code:  Form2.Show, Unload Form2.<br/>    c) Run the VB6 app.  Click Command1 3x.  Note that the Terminate event does not fire.  Close the App, note that the Terminate event fires 3x.<br/>    d) Remove InteropTextBox1 from the ActiveX control.<br/>    e) Run the VB6 app.  Click Command1 3x.  Note that the Terminate event fires each time Form2 is unloaded.</p>Wed, 28 Oct 2009 13:55:49 Z2009-11-12T15:51:26Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/2b9b18f7-988f-4a55-9bad-3cd380a53cebhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/2b9b18f7-988f-4a55-9bad-3cd380a53cebMike Orrhttp://social.msdn.microsoft.com/Profile/en-US/?user=Mike%20OrrCannot create ActiveX component?&lt;img&gt;http://img69.imageshack.us/img69/6182/activex.jpg&lt;/img&gt;<br/><br/>I am getting the following error:<br/><br/>'Cannot create ActiveX component.'<br/><br/>The code I have got so far:           'I get the error on 'Br = GetObject(, &quot;InternetExplorer&quot;)' this line.<br/><br/> <pre lang=x-vbnet>Imports System Imports System.IO Imports System.Uri Imports System.IO.File Imports System.Web Imports System.Configuration Imports System.Text Imports Microsoft.VisualBasic Imports System.Data Imports SHDocVw Public Class Form1 Dim Br As InternetExplorer Dim m As Object Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = True Timer1.Interval = 1000 End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick ' Try Br = GetObject(, &quot;InternetExplorer&quot;) 'Catch 'End Try m = Type.Missing For Each ie In New ShellWindows() If (ie.LocationURL = &quot;http://www.foo.com&quot;) Then ie.Navigate(&quot;http://www.bar.com&quot;, m, m, m, m, m) End If Next End Sub End Class <br/></pre>Tue, 10 Nov 2009 17:21:34 Z2009-11-11T22:15:25Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/2758293f-e738-4a59-9920-2e3884f99894http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/2758293f-e738-4a59-9920-2e3884f99894foremorecoasthttp://social.msdn.microsoft.com/Profile/en-US/?user=foremorecoastError Loading DLL<p>Hi!<br/><br/>I have looked everywhere in net but none solved my issue. I have a project that was created in VB6+sql server 2000. I am trying to migrate it to VB.NET.<br/>The project is made up of 3 sub projects. data access layer, business layer and presentation layer. I successfully migrated both DAL and BOL using VBupgrade.exe but when I tried to upgrade PL it complainted and said ensure it complies. originally i have vs installed in 2005 and not vb6. just to ensure that the project compiles fine I installed vb6. at times I also get error which is mentioned as in <a href="http://www.eggheadcafe.com/forumarchives/VisualBasiccom/Jan2006/post26072868.asp">http://www.eggheadcafe.com/forumarchives/VisualBasiccom/Jan2006/post26072868.asp</a> so I thought I should start from beginning and I opened all 3 vb6 project in vb6 environment. set the compatibily to project only and tried to compile first DAL, and then BL regenerated dll for each and when I tried to generate for PL it says access denied to overwrite existing DLL. i couldnt figure out why. now when I simply do &quot;start with full compile in PL&quot; I get error &quot;Compile Error: Error loading DLL&quot; which hits in class module as below<br/>-----------------------------------------------------------------------------<br/>'local variable(s) to hold property value(s)<br/>Option Explicit</p> <p>Public Function FGetErrAction(Response As Response, lngErrNo As Long, strErrSrc As String, strErrDsc As String) &lt;--here error is thrown<br/>    <br/>    Dim strReturnAction     As String<br/>    <br/>    On Error GoTo FGetErrAction_Error</p> <p>    strReturnAction = FDBFunctions(lngErrNo, strErrSrc, strErrDsc)<br/>    <br/>    'Response.Clear<br/>    <br/>    Response.Write strReturnAction</p> <p>FGetErrAction_Exit:<br/>    Exit Function<br/>    <br/>FGetErrAction_Error:<br/>        <br/>    Call FLogEvent(Err.Number, Err.Source, Err.Description)<br/>        <br/>    Response.Write conErrErr1</p> <p>End Function<br/>------------------------------------------------------------------<br/>I have already spend more than 3 days not sure whats wrong.<br/><br/>could anyone help me please? I have tried searching for reference of function FGetErrAction but I cant see any reference. when i delete everything from this module the error hits at .bas module as below<br/>Private Sub SOpenConnection(ByRef adoconErrors As ADODB.Connection, ByRef adoconErrLog As ADODB.Connection)<br/>'<br/>'Descr:  Opens and returns ADO Errors and ErrLog  database connection's<br/>'<br/>'Inputs:<br/>'adoconErrors   - ADO connection<br/>'adoconErrLog   - ADO connection<br/>'<br/>'process:     Opens ADO connection's</p> <p>    Dim strConn         As String<br/>    Dim strUsID         As String<br/>    Dim strPass         As String<br/>    Dim strDSN          As String<br/>    <br/>    On Error GoTo SOpenConnection_Error<br/>    <br/>    Set adoconErrors = CreateObject(&quot;ADODB.connection&quot;)<br/>    <br/>    adoconErrors.open conErrorsFileDsn, conErrUserId, conErrUserPwd<br/>    <br/>    Set adoconErrLog = CreateObject(&quot;ADODB.connection&quot;)<br/>    <br/>    adoconErrLog.open conErrLogFileDsn, conErrUserId, conErrUserPwd<br/>    <br/>    Exit Sub<br/>    <br/>SOpenConnection_Error:<br/>    <br/>    Err.Raise Err.Number, Err.Source, Err.Description</p> <p>End Sub<br/><br/>I think its something to do with ADODB.connection but what should I do about it?<br/><br/>could any one please help?</p>Tue, 26 May 2009 13:43:26 Z2009-11-11T16:17:19Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/3092e82d-a9d9-47fc-ab86-bf6f52a8daabhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/3092e82d-a9d9-47fc-ab86-bf6f52a8daabDeepMaroonhttp://social.msdn.microsoft.com/Profile/en-US/?user=DeepMaroonInterop DebugingIs there anyway to debug forms created in vb9 when debugging the vb6 project?Tue, 10 Nov 2009 00:51:25 Z2009-11-10T18:36:15Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/32a4d703-5e54-4d57-bea0-7bc903d3e832http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/32a4d703-5e54-4d57-bea0-7bc903d3e832Tiger39m9http://social.msdn.microsoft.com/Profile/en-US/?user=Tiger39m9how to make a vb6 app a childform of a .net applicationok now i made and standard exe app in vb6<br/><br/>what i would like to do with it is make it part of a .net application<br/><br/>not sure how to explain this but by saying making it like dock with my .net app<br/><br/>i know it will have to do with api calll i think  but dont know how to go about starting something like thisSat, 07 Nov 2009 04:17:57 Z2009-11-10T19:21:54Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/459a7418-6a65-4b49-9c7d-b7bbc319ed9chttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/459a7418-6a65-4b49-9c7d-b7bbc319ed9cAnilM_Nairhttp://social.msdn.microsoft.com/Profile/en-US/?user=AnilM_NairError while executing httpwebrequest.getrequeststream.<p class=MsoNormal style="margin:0in 0in 0pt"><strong><span style="font-family:Calibri;font-size:small"> </span></strong></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">  We migrated code from vb to vb.net. In vb msxml was used to make http requests and  in .net we changed to httpwebrequest. With this new implementation an exception is thrown while executing httpwebrequest.getrequeststream. </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:Calibri;font-size:small">The exception code is 10060 and the exception message is </span><strong><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:9pt">A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond</span></strong></p> <p class=MsoNormal style="margin:0in 0in 0pt"><strong><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:9pt"> </span></strong></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:9pt">This exception occurs intermittently and not always.</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Verdana', 'sans-serif';color:black;font-size:9pt"><br/></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:10pt">Please find below the code snippet which i've used to achieve the result</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"> </p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';color:blue;font-size:10pt">        Dim</span><span style="font-family:'Courier New';font-size:10pt"> HttpRequest <span style="color:blue">As</span> HttpWebRequest</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        <span style="color:blue">Dim</span> HttpResponse <span style="color:blue">As</span> HttpWebResponse</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        <span style="color:blue">Dim</span> streamReader <span style="color:blue">As</span> StreamReader</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        <span style="color:blue">Dim</span> streamWriter <span style="color:blue">As</span> StreamWriter</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpRequest = HttpWebRequest.Create(strUrl)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpRequest.Method = WebRequestMethods.Http.Post</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpRequest.ContentType = <span style="color:#a31515">&quot;text/xml&quot;</span></span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpRequest.Timeout = 999999999</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpRequest.ContentLength = Str(Len(temp))</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        streamWriter = <span style="color:blue">New</span> StreamWriter(HttpRequest.GetRequestStream)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        streamWriter.Write(temp)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        streamWriter.Flush()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        streamWriter.Close()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpRequest.GetRequestStream.Close()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpResponse = <span style="color:blue">CType</span>(HttpRequest.GetResponse, HttpWebResponse)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt"> </span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        streamReader = <span style="color:blue">New</span> StreamReader(HttpResponse.GetResponseStream)</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        temp = streamReader.ReadToEnd</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        streamReader.Close()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"><span style="font-family:'Courier New';font-size:10pt">        HttpResponse.Close()</span></p> <p class=MsoNormal style="margin:0in 0in 0pt"> </p> <span style="font-family:'Verdana', 'sans-serif';color:black;font-size:9pt">Please advice on a resolution<br/><br/>Thanks,<br/>Anil</span>Wed, 04 Nov 2009 10:46:20 Z2009-11-11T11:29:56Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/4851fc69-fb07-4584-8fec-0708bb8170f7http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/4851fc69-fb07-4584-8fec-0708bb8170f7Rajeev_RSDhttp://social.msdn.microsoft.com/Profile/en-US/?user=Rajeev_RSDCan anyone Resolve this NullReferenceException?I'm pasting the whole code, for the ease of you, in this the bold line was giving continues error:<br/> <br/> <em>Option Explicit On<br/> Option Compare Text<br/> <br/> Imports System<br/> Imports System.Collections<br/> Imports System.ComponentModel<br/> Imports System.Windows.Forms<br/> Imports Microsoft.Office.Interop.Excel<br/> <br/> <br/> Public Class TestForm<br/> <br/>     Private Sub TestForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br/>     End Sub<br/> <br/> <br/>     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br/>         Dim x() As Object = {2.648305, 4.934211, 7.04005, 9.014423, 11.09467, 13.0814, 15.06889, 17.08428}<br/>         Dim y() As Object = {15, 30, 45, 60, 75, 90, 105, 120}<br/>         Dim z(y.Length - 1) As Object<br/>         Dim i, j, k As Integer<br/>         Dim xstr, ystr, zstr As String<br/>         Dim exApp As Microsoft.Office.Interop.Excel.WorksheetFunction<br/>         Try<br/>             For i = 0 To x.Length<br/>                 For j = 0 To y.Length<br/>                     For k = 0 To z.Length<br/> <strong>                        z(k) = exApp.Slope(y(j), x(i))</strong> <br/>                     Next<br/>                 Next<br/>             Next<br/>             For i = 0 To x.Length<br/>                 xstr += x(i).ToString()<br/>             Next<br/>             For j = 0 To y.Length<br/>                 ystr += y(j).ToString()<br/>             Next<br/>             For k = 0 To z.Length<br/>                 zstr += z(k).ToString()<br/>             Next<br/>         Catch ex As Exception<br/>             MessageBox.Show(ex.Message)<br/>         End Try<br/>         xLabel.Text = &quot;X=&quot; + xstr.ToString()<br/>         yLabel.Text = &quot;Y=&quot; + ystr.ToString()<br/>         zLabel.Text = &quot;Z=&quot; + zstr.ToString()<br/>     End Sub<br/> End Class</em> <br/> <br/> The Bold Line always gives the same error:<br/> <em>System.NullReferenceException was caught<br/>   Message=&quot;Object reference not set to an instance of an object.&quot;<br/>   Source=&quot;AdsorptionSimulator&quot;<br/>   StackTrace:<br/>        at ChemChart.TestForm.Button1_Click(Object sender, EventArgs e) in C:\ChemChart\ChemChart\Forms\TestForm.vb:line 39<br/>   InnerException: </em> <br/> <br/> Please Can Anyone Help me, I need the Code urgently. <br/> <br/> Thanx in advance,<br/> <br/> - Rajeev<br/>Sat, 07 Nov 2009 13:16:21 Z2009-11-09T12:34:32Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/05a98dc3-c96c-44b6-829a-127a9088ae02http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/05a98dc3-c96c-44b6-829a-127a9088ae02burtonhttp://social.msdn.microsoft.com/Profile/en-US/?user=burtontoolstripbutton in interop usercontrol not releasing focus when vb6 shows modal dialog in response to clickHi,  I have been able to create an interop UserControl in VS08 with the toolkit, and everything seems to work perfectly except this one minor issue:<div><br></div><div>my usercontrol has a ToolStripButton.  on the click event of the ToolStripButton, i raise a custom event, ToolClicked.  I handle this is VB6 code, and show a second form modally.  When this second form appears, the first click anywhere on this form is ignored.  I noticed that the ToolStripButton's border stays &quot;hovered&quot; or &quot;focused&quot; until after the first click on my modal form.  One other thing that I noticed is that if I show a .Net form from VB6 code in response to the same ToolClicked event, it works fine.</div><div><br></div><div>repro steps:</div><div>1.  in VS08, create new VB6 Interop UserControl project.</div><div>2.  add a ToolStrip to the user control</div><div>3.  add a ToolStripButton to the ToolStrip</div><div>4.  in code for the UserControl, declare an event;  Public Event ToolClick()</div><div>5.  in the click event of the ToolStripButton, raiseevent the event;  RaiseEvent ToolClicked()</div><div>6.  build the project</div><div><br></div><div>7.  in VB6, create a new Standand EXE project</div><div>8.  in the Components dialog check the interop usercontrol</div><div>9.  add a Form, Form1, and draw the control on the form</div><div>10.  add another form, Form2, and add a button.</div><div>11.  in the button's click event call Me.Hide</div><div>12.  back on Form1, in code, select the ToolClicked event of the usercontrol</div><div>13.  add the following code to show Form2 modally:</div><div><span class=Apple-tab-span style="white-space:pre"> </span>Dim frm As New Form2</div><div>        frm.Show vbModal, Me<br></div><div>14.  run the project, and click the button on the ToolBar.</div><div>15.  notice that the first click on the button in Form2 is ignored, and after the first click the appearance of the ToolStripButton returns to &quot;unfocused&quot;</div><div><br></div><div><br></div>Wed, 21 Jan 2009 23:05:10 Z2009-11-09T09:29:57Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/b3985c81-320a-4dca-9e4e-1c40b8d3d381http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/b3985c81-320a-4dca-9e4e-1c40b8d3d381adhsyshttp://social.msdn.microsoft.com/Profile/en-US/?user=adhsysError in Setup Proj. (.tlb)Error massage in Setup proj. for an InteropControl:<br/>Please how can I find the reason of:<br/><span style="font-size:xx-small"> <p>&quot;Unable to create registration information for file named 'InteropControlOC.tlb&quot;<br/><br/>Thanks, adh</p> </span><hr class="sig">ADHTue, 03 Nov 2009 11:16:47 Z2009-11-10T02:09:42Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6b9edf95-22cf-42e7-b9ca-50bea5138e24http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/6b9edf95-22cf-42e7-b9ca-50bea5138e24Tyson---http://social.msdn.microsoft.com/Profile/en-US/?user=Tyson---Built-In Dialogs via Microsoft Excel Interop 11.0 Object Library<p>Hi.</p> <p>Im currently working on an Excel Add-in and I am wondering if its possible to bring up a built in dialog box to allow users to select cells, and then the selected cell references to be returned to my code. I have access to the Excel Interop 11.0 Object Library. </p> <p>I have found the following code to display various built-in Excel dialog boxes, however the documentation is poor and I cant find the correct built in dialog, and if I did, have no idea how to access its return values to find what the user selected. Due to the porting to C# .NET code, the following function is a bit messy and I have no idea what parameters each type of built in dialog takes.</p><font color="#008080" size=2><font size=2> <p>Microsoft.Office.Interop.Excel.</font>_Application <font color="#000000">ExcelApp = // Some code to access the underlying Excel API.</font></p></font> <p><font size=2><font size=2>ExcelApp.Dialogs[ </font><font color="#008080" size=2>XlBuiltInDialog</font><font size=2>.&lt;DialogTypeHere&gt; ].Show( // Lots of parameters );</font></font></p> <p><font size=2>where &lt;DialogTypeHere&gt; is one of the choices from the <font color="#008080">XlBuiltInDialog </font><font color="#000000">enum. <br></font></font><font size=2><font color="#000000">You can see the choices here: <a title="http://msdn2.microsoft.com/en-us/library/microsoft.office.interop.excel.xlbuiltindialog(VS.80).aspx" href="http://msdn2.microsoft.com/en-us/library/microsoft.office.interop.excel.xlbuiltindialog(VS.80).aspx">http://msdn2.microsoft.com/en-us/library/microsoft.office.interop.excel.xlbuiltindialog(VS.80).aspx</a></font></font></p> <p><font size=2>the Show method has the following signiture:</font></p> <p><font size=2>bool Dialog.Show( object Arg1, object Arg2, object Arg3, ... object Arg29, object Arg 30 );</font></p> <p>I am looking for a specific dialog that is often used all around Excel. The best way to descibe it would be the 'Insert Range Reference' dialog. It minimises the current form and allows the user to select a cell, then returning to the original form with the selected cells reference pasted into the corrosponding text box. </p> <p>For an example, within Excel 2003 (and probably most other versions) go to Insert -&gt; Name -&gt; Define. Within that form, click the little box in the bottom right, next to the &quot;Refers To:&quot; text box. That then minimised the 'Define Name' form, allows the user to select a range, and then restores the form, with the selected range's reference inserted back into the &quot;Refers To:&quot; text box. Im looking for similar functionality for my own Form within Excel.</p> <p>As there is a huge list of accessible built-in dialogs, I imagined this one would be easy to find. However, Im dubious to if its even possible, as I cant see how I would gain access to the selected range the user selected - the Show method simply returns a bool value. I could probably make my own, but it would not tie in as nicely with the original. </p> <p>Any ideas, comments, or similar previous experience is greatly appreciated.</p> <p>Cheers.</p> <p>Tyson.</p>Mon, 08 Jan 2007 05:43:13 Z2009-11-08T08:49:58Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/c87e84dc-e563-4a47-879b-8642f54d7d17http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/c87e84dc-e563-4a47-879b-8642f54d7d17Tiger39m9http://social.msdn.microsoft.com/Profile/en-US/?user=Tiger39m9how do u get text from a listbox in a differnt application i know i would have to use apis    but the only thing i can find for this is in vb6 or vc++ but nuttin for vb2008<br/><br/>i do know that LB_GETTEXT dont work<br/><br/>i do know how to find the window to the listbox,   but just cant get the text from the listboxThu, 22 Oct 2009 04:43:41 Z2009-11-06T18:44:30Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/e9a5b1bd-83ba-4f37-8854-4a3889550a88http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/e9a5b1bd-83ba-4f37-8854-4a3889550a88Tiger39m9http://social.msdn.microsoft.com/Profile/en-US/?user=Tiger39m9Need some help about a vb6 program i made and starting it in vb2008i made a program in vb6    made it a standard    Name.exe<br/><br/>now when i double click on it, it runs<br/><br/>and in vb2008  i try this <br/><br/>but when i try  process.start(&quot;Name.exe&quot;)   it says file not found<br/><br/>i am using vb6 and vb2008 on vista64 Fri, 06 Nov 2009 15:39:59 Z2009-11-06T18:28:29Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/5e944536-47d8-4d8d-b285-e7195cd583d6http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/5e944536-47d8-4d8d-b285-e7195cd583d6narsiCherukupallihttp://social.msdn.microsoft.com/Profile/en-US/?user=narsiCherukupallihow to pass hwnd from VB6 code in VB.net library using Interop<p>I need to pass a window handle (long) from VB6 client to a library written in VB.Net for some processing (using interop).  I don't know how to make use of the hwnd from VB6 and get the correct window handle in .Net.<br/><br/>Please help!<br/><br/>btw, Im on VS 2008 SP1 and .Net framework 3.5 SP1</p>Mon, 02 Nov 2009 22:41:29 Z2009-11-06T14:23:57Zhttp://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/1404580b-fc2e-46c2-94e5-530551c38997http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/1404580b-fc2e-46c2-94e5-530551c38997triunityhttp://social.msdn.microsoft.com/Profile/en-US/?user=triunityhow to raise user events in VS 2005 (COM) sub-Winform, handle in VB6<pre style="background:white"><span style="font-size:12pt;font-family:Verdana">I am trying to raise a user-defined Event in a VB.NET 2005 COM Class </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">(sub)form and have my calling VB6 form handle it.</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Code samples follow. In the VS 2005 code two events are coded identically - </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">when they are RAISEd in reaction to a Framework Event they WORK, but when they are RAISEd in response to by user action within the VB.NET 2005 Subform they do NOT:</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">' 1. Here are the Events, defined in the same fashion in the VS 2005 (sub)form</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">#Region &quot;User-Defined Variables&quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Public Event ExitOBRpayerDialog()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Public Event NetworkAvailabilityChanged( _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        ByVal IsAvailable As Boolean)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">' 2. Here are the Event Handlers for the Subs that will Raise the Events</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">' to the calling VB6 form, both added in the VS 2005 (sub)form constructor</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">#Region &quot; Windows Form Designer generated code &quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Public Sub New()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        MyBase.New()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        'This call is required by the Windows Form Designer.</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        InitializeComponent()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        'Add any initialization after the InitializeComponent() call</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        AddHandler Me.FormClosing, AddressOf frmOBRpayer_FormClosing</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        AddHandler My.Computer.Network.NetworkAvailabilityChanged, _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            AddressOf My_NetworkAvailabilityChanged</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        AddHandler btnCustom.Click, AddressOf btnCustom_Click</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span><span style="font-size:12pt;font-family:Verdana">    End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">3. Here are the VS 2005 Subs that are supposed to Raise the Events.</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">When the OS raises the My.Computer.Network.NetworkAvailabilityChanged</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">event, both User Events are raised by the first Sub below.  They BOTH</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">fire and are handled properly by the VB6 calling form!!!</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">When either of the other two Subs is executed it is because of a Form</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Event, i.e. a user clicking a button (Form Close in the 2nd sub and </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">btnCustom in the second).  In this case, NEITHER User Event that is RAISED</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">gets back to the VB6 program and neither is handled!!!  The VB6 code for both Events is similar also, but I include it further below for completeness </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">anyhow.</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">WHY oh WHY cannot I fire my User Events with a form button click?  WHY does an Event raised by the OS work and a user action does not???  (BTW, the way the OS fires both events is when I pull the network cable out of my </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">workstation).</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Public Sub My_NetworkAvailabilityChanged(ByVal sender As Object, _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">          ByVal e As _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">          Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        RaiseEvent ExitOBRpayerDialog()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        RaiseEvent NetworkAvailabilityChanged(e.IsNetworkAvailable)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Application.DoEvents()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">-----------------------------------------------------------------------------</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Public Sub frmOBRpayer_FormClosing(ByVal sender As Object, ByVal e As </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">System.Windows.Forms.FormClosingEventArgs)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Dim crCloseReason As Windows.Forms.CloseReason</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Dim ev As New </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs(False)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Try</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            crCloseReason = CloseReason.UserClosing</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            crCloseReason = e.CloseReason</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            Select Case crCloseReason</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                Case CloseReason.UserClosing</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    PayerCode = &quot;71LA&quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    RaiseEvent ExitOBRpayerDialog()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            ' DOES NOT FIRE - why oh why?</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    Application.DoEvents()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                Case Else</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    PayerCode = &quot;OOPS&quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    If OBRMode Then</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                        RaiseEvent ExitOBRpayerDialog()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            ' DOES NOT FIRE - why oh why?</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                        Application.DoEvents()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    Else</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                        RaiseEvent ExitOBRpayerDialog()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            ' DOES NOT FIRE - why oh why?</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                        Application.DoEvents()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">                    End If</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            End Select</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Catch ex As Exception</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            If exceptionPolicy.HandleException(ex) Then </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Me.handle_Ignorable_Exception(ex)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Finally</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            Call My_NetworkAvailabilityChanged(Me, ev)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            ' DOES NOT FIRE even though the Sub is the one that RAISEs </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">bothEvents!</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        End Try</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">-----------------------------------------------------------------------------</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Public Sub btnCustom_Click(ByVal sender As System.Object, ByVal e As </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">System.EventArgs)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        ' Does a custom form operation.  First removes any errors on the form,</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        ' then restores the data at it looked before the last user Save.</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Dim ev As New </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Microsoft.VisualBasic.Devices.NetworkAvailableEventArgs(True)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Try</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            Call My_NetworkAvailabilityChanged(Me, ev)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            ' DOES NOT FIRE even though the Sub is the one that RAISEs </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">bothEvents!</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        Catch ex As Exception</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">            If exceptionPolicy.HandleException(ex) Then </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Me.handle_Ignorable_Exception(ex)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        End Try</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">' 4. Here is the VB6 calling form code for handling the two User-Defined </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Events</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Option Explicit</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Private WithEvents clsOBRPayer As frmOBRpayer</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">...</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Private Sub Form_Load()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>' Instantiate the object defined above as &quot;With Events&quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>' Note that this object is NEVER reset to 'Nothing'.</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>Set clsOBRPayer = New frmOBRpayer</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">...</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>' Here is where the .NET (sub) form is actually run</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Public Sub cmdManipulatePayers_Click()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">   </span>Screen.MousePointer = vbHourglass</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">   </span></span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">      </span>With clsOBRPayer</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">         </span>.Billing_Patient_ID = 902264244</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">         </span>.Admit_ID = 1</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">         </span>.Patient_First_Name = &quot;Silly&quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">         </span>.Patient_Last_Name = &quot;Willy&quot;</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">         </span>.OBRMode = True</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">         </span>.runForm</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">      </span>End With</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">   </span>Screen.MousePointer = vbDefault</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style="">   </span></span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"><span style=""> </span>End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">-----------------------------------------------------</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">...</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>' Here are the Event Handlers for the two User-Defined events.  BOTH are</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>' handled and ONLY handled when the OS fires the</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> <span style="">  </span>' My.Computer.Network.NetworkAvailabilityChanged event</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">-----------------------------------------------------</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Private Sub clsOBRPayer_ExitOBRpayerDialog()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    ShowPayerCode</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Private Sub clsOBRPayer_NetworkAvailabilityChanged( _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        ByVal IsAvailable As Boolean)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    ShowAvailable IsAvailable</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Private Sub ShowPayerCode()</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    Dim intReturnCode As Integer</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    intReturnCode = MsgBox(&quot;PayerCode: [&quot; &amp; _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        clsOBRPayer.PayerCode &amp; &quot;], &quot; &amp; _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        &quot;Application_Startup_Path: [&quot; &amp; _</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">        clsOBRPayer.Application_Startup_Path &amp; &quot;].&quot;)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Private Sub ShowAvailable(IsAvailable As Boolean)</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">    MsgBox (IIf(IsAvailable, &quot;Online&quot;, &quot;Offline&quot;))</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">End Sub</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana"> </span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">===================================</span></pre><pre style="background:white"><span style="font-size:12pt;font-family:Verdana">Help would be much appreciated!  Warm regards ... triunity</span></pre>Thu, 07 Jun 2007 13:08:30 Z2009-11-06T05:03:37Z