Click here to Skip to main content
15,881,803 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: .Net 1.1 System.Configuration.ConfigurationSettings.AppSettings returning "nothing" [modified] Pin
JJDoherty9-Jul-09 8:03
JJDoherty9-Jul-09 8:03 
QuestionInsert file into Oracle blob filed with VB 2008 and Ado Pin
Filippo19749-Jul-09 3:23
Filippo19749-Jul-09 3:23 
AnswerRe: Insert file into Oracle blob filed with VB 2008 and Ado Pin
Dave Kreskowiak9-Jul-09 4:25
mveDave Kreskowiak9-Jul-09 4:25 
GeneralRe: Insert file into Oracle blob filed with VB 2008 and Ado Pin
Filippo19749-Jul-09 22:29
Filippo19749-Jul-09 22:29 
GeneralRe: Insert file into Oracle blob filed with VB 2008 and Ado Pin
Dave Kreskowiak10-Jul-09 3:14
mveDave Kreskowiak10-Jul-09 3:14 
QuestionHow can we get Primary Interop Assemblies installed? Pin
Raheem MA9-Jul-09 1:45
Raheem MA9-Jul-09 1:45 
AnswerRe: How can we get Primary Interop Assemblies installed? Pin
Dave Kreskowiak9-Jul-09 4:23
mveDave Kreskowiak9-Jul-09 4:23 
QuestionQuerInterface fails for an Interface of type IUnknown in VB .NET windows service but the same works in VB .NET forms application Pin
VM JOE9-Jul-09 1:22
VM JOE9-Jul-09 1:22 
Here is the IDL definition
[
          object,
          uuid(DAFB7D76-0158-452F-8FD0-FF97A683DEA3),
    
          helpstring("ITest Interface"),
          pointer_default(unique)
     ]
     interface ITest : IUnknown
     {
          [helpstring("method GetString")] HRESULT GetString([out,retval]   BSTR* pVal);
     };
    
[
     uuid(E768DC15-A19B-407C-ACF9-C420D6FDB1BE),
     version(1.0),
     helpstring("TestServer 1.0 Type Library")
]
library TESTSERVERLib
{
     importlib("stdole32.tlb");
     importlib("stdole2.tlb");

     [
          uuid(788571BD-030B-49CC-8C0A-2DF74E58331A),
          helpstring("Test Class")
     ]
     coclass Test
     {
          [default] interface ITest;
     };
};

The ATL COM Library uses APARTMENT threading model.

And the VB.NET windows service code fragment

            try
                  Dim obj As New TESTSERVERLib.Test
                  Dim s As String
                  s = obj.GetString()
            Catch ex As Exception
                  WriteToLog(ex.Message)
                  WriteToLog(ex.InnerException.ToString)
            End Try

When the code executes the following error occurs:

Unable to cast COM object of type 'TESTSERVERLib.TestClass' to interface type 'TESTSERVERLib.ITest'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{DAFB7D76-0158-452F-8FD0-FF97A683DEA3}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Object reference not set to an instance of an object.


But the same code works in VB.NET forms application.

Can anyone please explain the reason.
AnswerRe: QuerInterface fails for an Interface of type IUnknown in VB .NET windows service but the same works in VB .NET forms application Pin
Dave Kreskowiak9-Jul-09 4:22
mveDave Kreskowiak9-Jul-09 4:22 
QuestionRe: QuerInterface fails for an Interface of type IUnknown in VB .NET windows service but the same works in VB .NET forms application Pin
VM JOE9-Jul-09 8:30
VM JOE9-Jul-09 8:30 
AnswerRe: QuerInterface fails for an Interface of type IUnknown in VB .NET windows service but the same works in VB .NET forms application Pin
Dave Kreskowiak9-Jul-09 10:27
mveDave Kreskowiak9-Jul-09 10:27 
Questionhow can i connect crystal report to sqlserver with vb.net code ? Pin
xingselex9-Jul-09 0:44
xingselex9-Jul-09 0:44 
AnswerRe: how can i connect crystal report to sqlserver with vb.net code ? Pin
helelark1239-Jul-09 0:58
helelark1239-Jul-09 0:58 
AnswerRe: how can i connect crystal report to sqlserver with vb.net code ? Pin
Tom Deketelaere9-Jul-09 4:00
professionalTom Deketelaere9-Jul-09 4:00 
Questionvisual basic help Pin
Member 44064419-Jul-09 0:30
Member 44064419-Jul-09 0:30 
AnswerRe: visual basic help Pin
helelark1239-Jul-09 0:56
helelark1239-Jul-09 0:56 
AnswerRe: visual basic help Pin
Christian Graus9-Jul-09 2:18
protectorChristian Graus9-Jul-09 2:18 
GeneralRe: visual basic help Pin
Tom Deketelaere9-Jul-09 2:30
professionalTom Deketelaere9-Jul-09 2:30 
GeneralRe: visual basic help Pin
Christian Graus9-Jul-09 2:37
protectorChristian Graus9-Jul-09 2:37 
QuestionProblems regarding the code to send sms using .Net Pin
gjx_junxian19898-Jul-09 23:56
gjx_junxian19898-Jul-09 23:56 
AnswerRe: Problems regarding the code to send sms using .Net Pin
Dave Kreskowiak9-Jul-09 4:06
mveDave Kreskowiak9-Jul-09 4:06 
GeneralRe: Problems regarding the code to send sms using .Net Pin
gjx_junxian19899-Jul-09 4:27
gjx_junxian19899-Jul-09 4:27 
GeneralRe: Problems regarding the code to send sms using .Net Pin
Dave Kreskowiak9-Jul-09 7:36
mveDave Kreskowiak9-Jul-09 7:36 
QuestionDLLs required to use GetObject() method in VB.Net Pin
Raheem MA8-Jul-09 19:59
Raheem MA8-Jul-09 19:59 
AnswerRe: DLLs required to use GetObject() method in VB.Net Pin
tosch8-Jul-09 20:11
tosch8-Jul-09 20:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.