Click here to Skip to main content
15,918,193 members
Home / Discussions / C#
   

C#

 
GeneralRe: AI programming using C#.Net Pin
leppie19-Apr-04 9:43
leppie19-Apr-04 9:43 
GeneralRe: AI programming using C#.Net Pin
HAHAHA_NEXT19-Apr-04 11:42
HAHAHA_NEXT19-Apr-04 11:42 
GeneralRe: AI programming using C#.Net Pin
Mikko Puonti19-Apr-04 12:44
Mikko Puonti19-Apr-04 12:44 
GeneralAI programming using C#.Net Pin
Anonymous19-Apr-04 4:08
Anonymous19-Apr-04 4:08 
GeneralDirectory Picker Pin
bertcox19-Apr-04 3:38
bertcox19-Apr-04 3:38 
GeneralRe: Directory Picker Pin
Heath Stewart19-Apr-04 3:40
protectorHeath Stewart19-Apr-04 3:40 
GeneralRe: Directory Picker Pin
bertcox19-Apr-04 4:03
bertcox19-Apr-04 4:03 
Generalc++ client for c# server Pin
rana7419-Apr-04 2:04
rana7419-Apr-04 2:04 
I am trying to raw c++ client for a c# server and am stuck at a very strange point - i have gone through the documentations available but none seem to show an unmanaged c++ client(everyone prefers VB)
so here is my steps:

using System;
using System.Runtime.InteropServices;

namespace InterfaceNETServer
{

public interface INETServer
{
string Sayhi();
}
public class InterfaceNETServer:INETServer
{
public InterfaceNETServer()
{

}
public string Sayhi()
{
return "Hi from Server";
}
}
}

The generated typelib ,as from typelib viewer in ole view

// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: InterfaceServer.tlb

[
uuid(21D195E2-ECE9-340D-8CE0-079CDC12FAEF),
version(1.0)
]
library InterfaceNETServer
{
// TLib : // TLib : Common Language Runtime Library : {BED7F4EA-1A96-11D2-8F08-00A0C9A6186D}
importlib("mscorlib.tlb");
// TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("Stdole2.tlb");

// Forward declare all types defined in this typelib
interface INETServer;
interface _InterfaceNETServer;

[
odl,
uuid(1701A141-5AE7-35AE-BD6E-D389EDD66D65),
version(1.0),
dual,
oleautomation,
custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "InterfaceNETServer.INETServer")

]
interface INETServer : IDispatch {
[id(0x60020000)]
HRESULT Sayhi([out, retval] BSTR* pRetVal);
};

[
uuid(2D31E170-65BD-31DF-A526-90624DD704BB),
version(1.0),
custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "InterfaceNETServer.InterfaceNETServer")
]
coclass InterfaceNETServer {
[default] interface _InterfaceNETServer;
interface _Object;
interface INETServer;
};

[
odl,
uuid(DD603E31-4155-3DBE-B1BE-357E3863D3EE),
hidden,
dual,
oleautomation,
custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "InterfaceNETServer.InterfaceNETServer")

]
interface _InterfaceNETServer : IDispatch {
};
};


and my c++ client

#include <iostream.h>
#include <atlbase.h>
#import <mscorlib.tlb>

#import "..\InterfaceNETServer\bin\Debug\InterfaceServer.tlb" no_namespace named_guids
#include "stdafx.h"


int main(int argc, char* argv[])
{
INETServer * cpi= NULL;
CoInitialize(NULL);

CoUninitialize();
return 0;
}

There is no way i can make the compiler recognize the INETServer interface!!!!!!!!
Compiling...
StdAfx.cpp
Compiling...
CLientforNetInterop.cpp
D:\CSHARP\NETSERVERFORINTEROP\CLientforNetInterop\CLientforNetInterop.cpp(15) : error C2065: 'INETServer' : undeclared identifier


The path to the tlb cannot be worng,as i can open the tlb through 'right click->open document' from within this file.Whats wrong ?
GeneralRe: c++ client for c# server Pin
Heath Stewart19-Apr-04 3:17
protectorHeath Stewart19-Apr-04 3:17 
GeneralRe: c++ client for c# server Pin
rana7419-Apr-04 18:12
rana7419-Apr-04 18:12 
GeneralRe: c++ client for c# server Pin
Heath Stewart20-Apr-04 3:17
protectorHeath Stewart20-Apr-04 3:17 
GeneralConvert from string to Color Pin
Member 74394419-Apr-04 1:49
Member 74394419-Apr-04 1:49 
GeneralRe: Convert from string to Color Pin
Heath Stewart19-Apr-04 3:22
protectorHeath Stewart19-Apr-04 3:22 
GeneralRe: Convert from string to Color Pin
Member 74394419-Apr-04 3:40
Member 74394419-Apr-04 3:40 
GeneralRe: Convert from string to Color Pin
Heath Stewart19-Apr-04 4:01
protectorHeath Stewart19-Apr-04 4:01 
GeneralConvert from string to Color Pin
Member 74394419-Apr-04 1:44
Member 74394419-Apr-04 1:44 
GeneralRe: Convert from string to Color Pin
Mike Ellison19-Apr-04 4:07
Mike Ellison19-Apr-04 4:07 
QuestionCan Fill? Pin
wokankan19-Apr-04 1:33
wokankan19-Apr-04 1:33 
AnswerRe: Can Fill? Pin
mhmoud rawas19-Apr-04 2:11
mhmoud rawas19-Apr-04 2:11 
GeneralRe: Can Fill? Pin
wokankan19-Apr-04 2:45
wokankan19-Apr-04 2:45 
GeneralRe: Can Fill? Pin
Heath Stewart19-Apr-04 3:23
protectorHeath Stewart19-Apr-04 3:23 
AnswerRe: Can Fill? Pin
Heath Stewart19-Apr-04 3:26
protectorHeath Stewart19-Apr-04 3:26 
GeneralRe: Can Fill? Pin
wokankan19-Apr-04 4:21
wokankan19-Apr-04 4:21 
GeneralNavigating tabs with MDI Application Pin
Jon G19-Apr-04 1:02
Jon G19-Apr-04 1:02 
GeneralRe: Navigating tabs with MDI Application Pin
Dave Kreskowiak19-Apr-04 1:31
mveDave Kreskowiak19-Apr-04 1:31 

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.