|
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Good reply!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I know you meant to post this question here[^]
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
hello,
I created a win32 project(precompiled headers, console application). This was created to create a service( for which i used SERVICE_TABLE_ENTRY, SERVICE_STATUS, SERVICE_STATUS_HANDLE, etc... required structures and methods).
Environment used:
Windows XP, VC++.Net2005.
Should work on:
I want to make this exe to run on windows 95,98, XP, 2000 and Vista.
my stdafx.h file contains:
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
#pragma warning (disable:4430)//... i added this, since i was getting this error. and in msdn this //was given as its solution.
To this project, i have added two more files:
1) USBActivity.h
2) USBActivity.cpp
In USBActivity.cpp the hierarchy of headers included is as follows:
#include "stdafx.h"
#include <initguid.h>
#include "stdio.h"
#include <setupapi.h>
#include <dbt.h>
#include "afxcmn.h"
#include "cfgmgr32.h"
#include "Blowfish_Data_FileEncrpt.h"
#include "USBActivity.h"
The project properties are set as: Use windows Standard libraries, WIN32;_DEBUG;_CONSOLE as preprocessor definitions, Basic Run-TimeChks: Both (/RTC1, equiv. to /RTCsu) , RunTime-Library --> Multi-threaded Debug (/MTd), Use Precompiled Header (/Yu), Linker+AdditionalDependencies-->setupapi.lib.
I am getting following build errors:
Compiling...
stdafx.cpp
Compiling...
Blowfish_Data_FileEncrpt.cpp
DataSentinelService.cpp
d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation
DoubleBuffering.cpp
SHA.cpp
USBActivity.cpp
d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier
d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
DataSentinelService - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I guess the error is because of :
--> calling a function in an SDK header file that is currently not supported in current build environment.
Could anybody help me out... in fixing this problem.
I have also seen the project given at the following link: http://www.codeproject.com/system/RemoveDriveByLetter.asp?df=100&forumid=294340&exp=0&select=1822184&tid=1815457#xx1822184xx
Here, it is given in vc++ 6. and when i compared the build environment everything was same.
In order to enumerate enumerate all the USB devices connected to PC, using a windows service... i have to use setupAPI in order to get setupDiGetDevClass etc methods.
I also tried with including windows.h file in stdafx.h. but it was also not helpful. since was included by-default. And on including it again i am getting the following error:
d:\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
Is there any other alternative?
Thanks
Anee
Anee
|
|
|
|
|
This question is no where related to CLI and you have already asked it in VC++[^] forum. So dont cross-post and choose correct forum.
|
|
|
|
|
Hi,
A long long time ago in a compiler far far beyond now, VS2005 without sp1 ... -_-, i've developed a project using native C++ and a lame shell interface, now i thought it could be fun converting the project to a C++/CLI DLL with a managed wrapper class for the main functionality normally controlled by the old shell input and an interface developed in C#, this all works great, however as soon as i switch my executable to dll build, i get a fatal error in the interface telling me he cant load the assembly updater3 wich is my managed dll. I probably thought this would be because the lack of a AssemblyInfo file, however creating a new dll, ripping the assemblyinfo and editing it doesnt help a bit.
Is there someone who can tell me wich rules apply when converting a native application to a managed dll
Thanks already!
|
|
|
|
|
|
Hi.
How could I flush the input buffer in C++/CLI? (in a Console Application of course):->.
Like fflush(stdin) does in C.
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Demian Panello wrote: Like fflush(stdin) does in C.
What about using System::IO::FileStream::Flush() ?
|
|
|
|
|
Thank you Prasad.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Hello,
i want to use a Lib in a C# Projekt. Therefore i want to reconfig the Lib-Project (all sources) into a dll Project.
new Settings:
Configuration Typt: Dynamic Library (.dll)
Common Language Runtime support: Common Language Runtime Support (/clr)
For Debug:
Enable C++ Exceptions: No
Runtime Library: Multi-threaded Debug DLL (/MDd)
After this i wand to compile the Project and get a D8045 Error.
-------------------
Only C++ source code files can be passed to a compilation that uses /clr. Use /TP to compile a .c file as a .cpp file; see /Tc, /Tp, /TC, /TP (Specify Source File Type) for more information.
-------------------
one source-File is a c-File.
does that run at all ore have i find another solution?
|
|
|
|
|
Did you follow the instructions in the error message?
Use /TP to compile a .c file as a .cpp file; see /Tc, /Tp, /TC, /TP (Specify Source File Type) for more information.
led mike
|
|
|
|
|
Hi all,
Iam working on Pointers. How would I pass this memory location as an argument to a function?
ie.,
#define REG (*((volatile unsigned long *) 0x3FFFC00E))
this is my function
void funcTest( unsigned long reg, char value)<br />
{<br />
reg= value;<br />
}<br />
I need to pass the "REG" as an argument so that I write the "value" to that particular memory location or the register.
|
|
|
|
|
I'm not sure what you are trying to do...
REG dereferences the pointer so it becomes the unsigned long stored at address 0x3FFFC00E.
You need a reference or pointer to an object passed to a funtion if you want to modify the object
in the function:
Then in your func you assign a char to an unsigned long??
Whatcha tryin to do?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Looks to me like you're in the wrong forum, this doesn't look like a .NET C++ question. Try the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If I have a C# only application I could ship my application without worrying about the target platform.
However if I have a Managed C++ DLL I should, it seems, provide a 32bits installer and a 64bits installer.
Right now I'm considering ship 2 version of the ManagedC++ DLL with a C# wrapper which call into the appropriate one depending of the platform.
But this a lot of work to create this wrapper.
Particularly as I declare some managed struct in the Managed C++ library which I pass around.
Is there any better and quicker way to be platform independant?
One of the problem we face is we create installer for affiliates.
All the installer together are quite big.
If I should now double the size because of 32bits/64bits consideration that becomes daunting...
-- moved at 21:21 Tuesday 20th March, 2007
|
|
|
|
|
Super Lloyd wrote:
Is there any better and quicker way to be platform independant?
I'd just stick to both...
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
|
Please ask in the VC++ forum. This one's for C++/CLI related stuff.
|
|
|
|
|
dear programmers,i have started my first programming experience with C++,
and i have read the DEITEL c++ book,i want to know,what should i do now?
should i continue with the MFC or C#.net 2005?thanks
khodadad pakdaman
pakdaman@cleanmail.it
|
|
|
|
|
You should probably ask your questions in the right forum, this one is for neither C++, nor C#, but for C++/CLI.
It depends what you want to do. C# is probably a more likely choice.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: It depends what you want to do. C# is probably a more likely choice.
Definitely the appropriate path after finishing the book on C++
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Easier to use, better library support, more support online, I'd say it's a more likely choice for someone starting to program windows.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I know I was entertained by the response after the original post.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi,
I'm running a team where our .net development is going to need to integrate with some commercial software with C++ APIs. I've identified Managed C++ as the implementation mechanism for integrating the technologies and we have a couple of prototypes working...
.. however, I've managed to convince the Project Manager that we should have a couple of reference books available for the team.
Can anyone recommend any MC++ books, specifically Visual Studio 2005?
Regards,
Ray
|
|
|
|