|
I am using Visual C++ (I know, no duh) Intro ed. I have been lookin at the "Interoperating with Windows Media Player using P/Invoke and C#" B Alex Kent and it told me to use the System.Runtime.InteropServices namespace in my code, but every time i try to use it the compiler tells me it isn't a namespace. I might just be being stupid or something, but could someone help please!
|
|
|
|
|
The System.Runtime.InteropServices namespace is part of the .NET framework so you'll need
to use C++/CLI (managed C++) to use its members.
If you don't want to or can't use .NET then the WMP SDK[^] has info that may be of help.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
This is also probably going to sound like a stupid question, but how do i use C++/CLI in my file?
|
|
|
|
|
That's a big topic!
For starters you need VS2003 .Net or better. A switch in the build (compiler) properties for
a project will compile an existing project for the CLR (common language runtime).
From there there's a wealth of stuff to learn and use in the ,net framework. With C++ you can
mix managed/unmanaged code and even compile portions of individual modules to managed or
unmanaged.
Managed C++ adds some stuff including a garbage-collected heap (you don't
need to free managed objects when you're through with them) as well as access to the .NET
framework. Mixing C++ and managed C++ makes it a bit trickier. There's new data types for
managed code too.
That's just what comes to mind immediately. There's literally bookloads of info
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
I feel kinda silla but could you be more specific about where build properties stuff is cuz i am having trouble finding what your talking about.
|
|
|
|
|
No problem - I'm pretty sure everyone does this stuff for the first time
What version of Visual Studio? Note that in 2003, the managed C++ syntax wasn't formalized so
it uses "managed extensions for C++" syntax. For VS 2005, the managed syntax for C++ is an
official extension to the language (and is different from 2003).
From solution explorer, right-click the project and choose "Properties"
For VS 2003 .NET
Configuration Properties/General/Use Managed Extensions
For VS2005
Configuration Properties/General/Common Language Runtime Support (you'll probably want the "/clr"
setting for an existing unmanaged project).
After a complete rebuild, your app will be a .NET assembly. Instead of CPU machine code, it is
compiled to MSIL. At runtime, it's just-in-time compiled to machine code.
You probably won't notice it, except in the debugger. The first time I tried it on a large
solution with an MFC exe using DirectX, Windows Media, GDI+, etc it built and ran first try, no
problems.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hey thanks for all the help it was useful, unfortunalty I only have MS Visual C++ 6.0 Intro Ed. (although it seems as though i have the .NET framework if i look on the C drive), but i have resources to Visual Studio .NET 2003 so i might try it there. Once again thanks for all your help.
"That's the difference between me and the rest of the world! Happiness isn't good enough for me! I demand euphoria!" -Calvin and Hobbes
|
|
|
|
|
How do i remove a project (.dsp) from the workspace (.dsw) ? The .dsw file says the following
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
Is there a way where I can remove the unwanted project ?
Engineering is the effort !
|
|
|
|
|
Go to ClassView, select the project in the tree, then press Delete.
|
|
|
|
|
act_x wrote: How do i remove a project (.dsp) from the workspace (.dsw) ? The .dsw file says the following
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
Is there a way where I can remove the unwanted project ?
humm.. it just warning!.. if you have confidence go ahead!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Your best bet is to move to using GDI+, which allows you to specify a transpareny color, and also a level of opacity.
This sort of stuff is a nightmare in GDI. I'd tend to do it by writing my own alphablend that allows me to specify a mask color, and just skip those bits.
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 )
|
|
|
|
|
Hello,
I am looking for a callback function or event (I prefere a callback function) that is called or signaled in case your surface is lost and you are able to restore it. In case of a change of display mode this can easily be done with the message WM_DISPLAYCHANGE. But in case the user presses for example crtl+alt+del (An other application gets exclusive acces to the hardware) then this event is not given.
Thanks
|
|
|
|
|
Hi,
I am using Visual C++ 2005 (no managed C++). Basically, I have a local folder:
c:\local\data
and a remote folder:
\\remote\data
and I want to copy the directories, subdirectories, and the files in them from
c:\local\data
to
\\remote\data
without writing over any existing files. Likewise, I want to then copy the directories, subdirectories, and the files in them from
\\remote\data
to
c:\local\data
without writing over any existing files.
NOTE: The arbitrary remote folder may be defined already as a const char *, but it may not exist yet. The arbitrary local folder, however, would be. All strings come through as const char *'s.
What is the easiest solution without using managed C++?
Thanks!
Raj
-- modified at 15:56 Tuesday 3rd April, 2007
|
|
|
|
|
nakranir wrote: What is the easiest solution without using managed C++?
Have you looked at SHFileOperation() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yeah, unfortunately, I can't seen to get it to work. Multiple and various error codes (obviously). I've tried hard coding the \\'s into the path and it still didn't work, althuogh the string looked fine when debugging on breakpoints.
Perhaps I'm just not doing something right with that, but I have copied code that I have found on the 'net and slightly modified it to handle my specific strings.
|
|
|
|
|
I wonder why someone voted you down.
Just a thought: Could it be that you are doing the "standard" mistake when it comes to the backslash character in paths?
Do you have "\\\\remote\\data" in your source code?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
nakranir wrote: Multiple and various error codes (obviously).
Can you turn your monitor a little to the left? I'm having a hard time seeing those error messages.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
nakranir wrote: Perhaps I'm just not doing something right with that, but I have copied code that I have found on the 'net and slightly modified it to handle my specific strings.
could you please state you error here!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Can a prgram (in VC6) determine if the current user is member of the Administrators Group?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
Thanks!
I'll try...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
I.ve used the example shown on the mentioned link, but, trying to use CheckTokenMembership() it didn't work: in VC6 it isn't recognized!
Why?
Anyway, thanks again!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Same reason as Judy explained below You need a newer SDK!
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Win32 API call IsUserAnAdmin
supported under Win2000 and up
Judy
|
|
|
|
|
Wow! I need to upgrade from Windows 3.1!
I'm not the OP but Thanks Judy!
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|