Click here to Skip to main content
15,914,221 members
Home / Discussions / COM
   

COM

 
QuestionIt still gives "Unknown Publisher" error even after signing ActiveX control Pin
dharmesh@krishtechnologies.net8-Oct-08 23:22
dharmesh@krishtechnologies.net8-Oct-08 23:22 
QuestionReleasing CComPtr Pin
alchong8-Oct-08 13:34
alchong8-Oct-08 13:34 
AnswerRe: Releasing CComPtr Pin
Lim Bio Liong8-Oct-08 18:45
Lim Bio Liong8-Oct-08 18:45 
GeneralRe: Releasing CComPtr Pin
alchong9-Oct-08 5:57
alchong9-Oct-08 5:57 
QuestionDCOM Config Pin
Kipetcoff8-Oct-08 5:26
Kipetcoff8-Oct-08 5:26 
QuestionLaunch as interactive user Pin
SteveTheHalfB8-Oct-08 4:44
SteveTheHalfB8-Oct-08 4:44 
AnswerRe: Launch as interactive user Pin
SteveTheHalfB12-Oct-08 23:53
SteveTheHalfB12-Oct-08 23:53 
QuestionAssertion failed: _pAtlModule == 0 Pin
Christian Bayer6-Oct-08 6:51
Christian Bayer6-Oct-08 6:51 
Hello!

I am working on a C# COM-Server and a C++ COM client app. The client in fact
loads a dll-plugin containing the COM client in a class that acts as a com
event reciever:

extern "C"
__declspec(dllexport)
int ndofInit();

extern "C"
__declspec(dllexport)
void* ndofOpen(void* wnd);

extern "C"
__declspec(dllexport)
void ndofShutdown(void* deviceHandle);

[ event_receiver(com) ]
[ module(type=dll, name="NDOF") ]
class NDOFServer
{
public:
NDOFServer() {}
virtual ~NDOFServer();

...
}

Everytime I start the client I get the following error:

Debug Assertion failed!
Program ...
File: C:\Programme\Microsoft Visual Studio 8\VC\atlmfc\include\atlbase.h
Line 2706

Expression _pAtlModule == 0

Clicking Retry and returning to my code reveals that this error occurs when
the constructor of NDOFServer() is called.
The constructor is called this way by the client app:

extern "C"
__declspec(dllexport)
int ndofInit()
{
if (sNdofServer == NULL)
sNdofServer = new NDOFServer();

return 1;
}

This error seems not to occur when the client plugin-DLL is used with
another COM server offering the same classes etc. written in C++ (whose code
I do not know).

I tried to switch some more or less relevant options in the project
properties like:
- MFC usage static/shared/Windows shared
- ATL usage static/shared/none
- minimize CRT usage in ATL yes/no
- CLR support no/CLR

stdafx.h looks like this:

#if defined(_WIN32)
#ifndef WINVER // Allow use of features specific to #define WINVER
0x0501 // Change this to to target other
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to
#define _WIN32_WINNT 0x0501 // (was 0x0501) Change to target other versions
#endif

#ifndef _WIN32_WINDOWS // Allow use of features specific to
#define _WIN32_WINDOWS 0x0410 // Change this to target Windows Me or later.
#endif

#ifndef _WIN32_IE // Allow use of features specific to IE
#define _WIN32_IE 0x0600 // Change this to target other versions of IE.
#endif

#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#include <atlbase.h>
#include <atlcom.h>

<---->
//#include <atlwin.h>
//#include <atltypes.h>
//#include <atlctl.h>
//#include <atlhost.h>
--> commenting these headers out did neither help nor hurt

using namespace ATL;
#import "progid:AerionInput.Device" embedded_idl no_namespace
#endif //_WIN32

The C# DLL is nothing spectacular and the "main" class(or the first one
being instanciated), which is not instanciated at this time. The COM-visible
interface looks like this:

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace AerionInput
{
[
Guid("CB3BF65E-0816-482A-BB11-64AF1E837812"),
InterfaceType(ComInterfaceType.InterfaceIsDual)
]
public interface ISimpleDevice
{
int Type
{
get;
}

IKeyboard Keyboard
{
get;
}

ISensor Sensor
{
get;
}

void Connect();
void Disconnect();
void LoadPreferences(string preferencesName);
}
}

And the AssemblyInfo.cs reads this like:

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("TDxInput")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("n/a")]
[assembly: AssemblyProduct("TDxInput")]
[assembly: AssemblyCopyright("Copyright © n/a 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(true)]
[assembly: Guid("7858b9e0-5793-4be4-9b53-661d922790d2")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


I am doing this on Windows 2000 with Visual Studio 2005 Pro latest SP and
.NET 2.0.50727 SP1.

Thanks in advance,
Christian
QuestionRuns on Server, not on Workstations Pin
rahvyn133-Oct-08 6:32
rahvyn133-Oct-08 6:32 
QuestionHeaders created by MIDL, position of DECLSPEC_UUID Pin
Andreas Tondorf1-Oct-08 22:13
Andreas Tondorf1-Oct-08 22:13 
QuestionHow do I pass MySQL connection ID to COM using VC++ 9.0? Pin
Ger Hayden30-Sep-08 7:22
Ger Hayden30-Sep-08 7:22 
QuestionCOM add in for MS Office Outlook? Pin
maui_mike29-Sep-08 20:19
maui_mike29-Sep-08 20:19 
QuestionMMDeviceEnumerator registration problem Pin
punitkumar2629-Sep-08 13:09
punitkumar2629-Sep-08 13:09 
QuestionUsing C# and COM to connect to a Server Pin
SRogers8829-Sep-08 7:44
SRogers8829-Sep-08 7:44 
AnswerRe: Using C# and COM to connect to a Server Pin
alchong8-Oct-08 14:19
alchong8-Oct-08 14:19 
QuestionGet COM pointer to running instance of Yahoo Messenger. Pin
u0m326-Sep-08 7:02
u0m326-Sep-08 7:02 
QuestionHow to Include MFC Datatypes in IDl ? Pin
narayanagvs25-Sep-08 23:20
narayanagvs25-Sep-08 23:20 
QuestionExtra Chart in OWC11 (ASP)! Pin
marlboroguy5824-Sep-08 1:35
marlboroguy5824-Sep-08 1:35 
QuestionWord Automation Pin
g_dev23-Sep-08 18:37
g_dev23-Sep-08 18:37 
AnswerRe: Word Automation Pin
kattah28-Jan-09 13:03
kattah28-Jan-09 13:03 
QuestionWord Automation Pin
g_dev23-Sep-08 18:36
g_dev23-Sep-08 18:36 
Questionvc++ and .net Runtime error Pin
balu1234522-Sep-08 9:15
balu1234522-Sep-08 9:15 
QuestionSynchronization concepts.. [modified] Pin
kDevloper21-Sep-08 21:13
kDevloper21-Sep-08 21:13 
AnswerRe: Synchronization concepts.. Pin
John_Adams3-Oct-08 12:47
John_Adams3-Oct-08 12:47 
GeneralRe: Synchronization concepts.. Pin
kDevloper3-Oct-08 18:25
kDevloper3-Oct-08 18:25 

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.