Click here to Skip to main content
11,934,809 members (47,418 online)
Rate this:
Please Sign up or sign in to vote.
using namespace System;
using namespace Interop.SpotOnCCD_USB2; // the required Dll which i have also referenced. 
using namespace std;
using namespace System::Runtime::InteropServices;
using namespace System::Diagnostics;
#include "stdafx.h"
ref class New
/*error C2337,C2059,C2143*/[System.Runtime.InteropServices.DllImport("Interop.SpotOnCCD_USB2.dll")]
/*error C2653,C2238 */static void GetMatrix([MarshalAs(UnmanagedType::LPArray)] array<int>^ );
int main(array<System::String ^> ^args)

Hi! I am trying to create a CLR DLL which references a dll named "Interop.SpotOnCCD_USB2.dll". I am working with VS2008.

As far as i have checked and have used the same code in VS2010 without such errors. Please let me know what you think!!

my questions are dependent on the given code.I get the following list of errors:

error C2337: "System": Attribute not found .

error C2143: Syntaxerror: missing ']' before '.'

error C2059: Syntaxerror: '.'

error C2653: 'UnmanagedType':is not a class or namespace name

error C2238: unexpected token(s) preceding';'

Thanks in advance!!
Posted 28-Aug-12 6:01am
lewax00 28-Aug-12 11:16am
If you're using C++/CLI, why do you need to use P/Invoke, can't you just access it directly?
kash_sheetansh 28-Aug-12 11:22am
its a com dll. I know i could easily access it directly for any other DLL but i cant.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The first set of errors (maybe all of them) should be solved fairly easily: . is not used for namespaces in C++/CLI, :: is, so change

Not sure if that will fix all of your errors, but it should clear up a few.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 28 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100