473,385 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Compile error C3641

I am receiving a compile error when attempting to include Directshow in a
managed C++ program using Visual C++ 2005 Express Edition Version 8. The
..NET framework is version 2.0.50727. To recreate the error, do the
following steps in Visual C++ 2005 Express Edition:
1. Create a new Windows Forms Application called "Test".
2. In Form1.h, after the #pragma once declaration, add the line "#include
<dshow.h>".
3. Add the Platform SDK and DirectX include folders to the project (I am
using the DirectX 9 SDK from August 2005).
4. Build the solution.

I get a whole lot of errors along the lines of "C:\Program Files\Microsoft
Platform SDK\Include\strsafe.h(431) : error C3641: 'StringCchCopyA' :
invalid calling convention '__stdcall ' for function compiled with /clr:pure
or /clr:safe". I know that I am mixing managed and unmanaged code in my
project. Do I need to create another unmanaged class and include Directshow
in that class? If so, how would I declare such a class? Or do I need to
change my compiler settings?

Any assistance anyone could provide would be much appreciated. If you need
more information, let me know.

Thanks a lot.
Wayne
Dec 31 '05 #1
3 6229
Wayne Allen wrote:
I am receiving a compile error when attempting to include Directshow
in a managed C++ program using Visual C++ 2005 Express Edition
Version 8. The .NET framework is version 2.0.50727. To recreate the
error, do the following steps in Visual C++ 2005 Express Edition:
1. Create a new Windows Forms Application called "Test".
2. In Form1.h, after the #pragma once declaration, add the line
"#include <dshow.h>".
3. Add the Platform SDK and DirectX include folders to the project (I
am using the DirectX 9 SDK from August 2005).
4. Build the solution.

I get a whole lot of errors along the lines of "C:\Program
Files\Microsoft Platform SDK\Include\strsafe.h(431) : error C3641:
'StringCchCopyA' : invalid calling convention '__stdcall ' for
function compiled with /clr:pure or /clr:safe".

Well, the error message seems pretty explanatory to me : You are mixing
managed and unmanaged code, so you need to compile with /clr switch, not
with /clr:pure nor /clr:safe : Change your project settings to build a mixed
mode assembly.

Arnaud
MVP - VC
Dec 31 '05 #2
Oh my god...I was having such a blonde moment!! Thanks so much for your
quick response and help.
"Arnaud Debaene" <ad******@club-internet.fr> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Wayne Allen wrote:
I am receiving a compile error when attempting to include Directshow
in a managed C++ program using Visual C++ 2005 Express Edition
Version 8. The .NET framework is version 2.0.50727. To recreate the
error, do the following steps in Visual C++ 2005 Express Edition:
1. Create a new Windows Forms Application called "Test".
2. In Form1.h, after the #pragma once declaration, add the line
"#include <dshow.h>".
3. Add the Platform SDK and DirectX include folders to the project (I
am using the DirectX 9 SDK from August 2005).
4. Build the solution.

I get a whole lot of errors along the lines of "C:\Program
Files\Microsoft Platform SDK\Include\strsafe.h(431) : error C3641:
'StringCchCopyA' : invalid calling convention '__stdcall ' for
function compiled with /clr:pure or /clr:safe".

Well, the error message seems pretty explanatory to me : You are mixing
managed and unmanaged code, so you need to compile with /clr switch, not
with /clr:pure nor /clr:safe : Change your project settings to build a
mixed mode assembly.

Arnaud
MVP - VC

Dec 31 '05 #3
Wayne Allen wrote:
Oh my god...I was having such a blonde moment!! Thanks so much for
your quick response and help.


You may also want to make sure that DirectShow is parsed as unmanaged:

#pragma managed(push,off)
#include <dshow.h>
#pragma managed(pop)

-cd
Dec 31 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Danny Boelens | last post by:
Hi all, today I ran into a compile error after a compiler upgrade. I made a small example to demonstrate my compile error: template<typename T1, typename T2> class A {}; class B
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
3
by: Peter | last post by:
Hi, I am trying to compile an existing project (originally c) in .NET (rename .c files to .cpp). After fixing some problems, here are the ones that I don't know how to deal with:...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
0
by: Jim Heavey | last post by:
Internal Compiler Error: stage 'BEGIN' Hello, I had an application which was working just fine and I decided to modify all database access within the application to utilizie a new Namespace that I...
5
by: MLH | last post by:
A97 aborts creation of MDE reporting that there's a compile error in one form. Sure enough, if I remove the form from the source database and attempt to compile the MDE, it succeeds. But when I...
5
by: wong_powah | last post by:
#include <vector> #include <iostream> using std::cout; using std::vector; enum {DATASIZE = 20}; typedef unsigned char data_t;
7
by: Arjuna | last post by:
I have a class template (ExclusiveMap) which takes two type parameters C1 and C2 and declares two private members map<C1, C2> and map<C2, C1> (both STL maps). In test code I instantiate this class...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.