|
Do you mean linking html and C++ like how ASPX and C# code behinds work or something else?
Steve Maier, MCSD MCAD
|
|
|
|
|
I am just looking for a way to link HTML pages to C++ or better yet, if you know how to insert flash into C++ 6.
I know that Java and HTML can be linked.
Thanks,
Peter
Peter Heylin
|
|
|
|
|
I want to play sound using winapi, so I wrote these lines of code:-
-------------------------------------------------------------------------------------------------------------------
using namespace System;
using namespace System::Runtime::InteropServices;
namespace WavAPI
{
[DllImport("winmm.dll")]
extern "C" bool sndPlaySound(String* lpszSound, unsigned int fuSound);
}
-------------------------------------------------------------------------------------------------------------------
But I got "FILETIME: ambiguous symbol" when I compiled, because FILETIME is both the member of InteropService namespace and defined in WinDef.h.
I tried to use #undef FILETIME, but it didn't work. How can I solve this problem? Or is there another way to play sound from API?
|
|
|
|
|
You could, instead of using the,
#include "windows.h"
line at the beginning of your code, use fully qualified names everywhere in your application. If it's a large and complex program, however, you will probably hate this suggestion.
|
|
|
|
|
Quoted from message:
You could, instead of using the,
#include "windows.h"
line at the beginning of your code, use fully qualified names everywhere in your application. If it's a large and complex program, however, you will probably hate this suggestion.
I ran into this same situation when I needed to make a direct call to the Win32 API. The problem was that it was necessary to add using namespace System::Runtime::InteropServices to get the DllImport attribute to work. There was no way to use a "fully qualified" name. My code was not referencing "FILETIME" anywhere in the application. It was a conflict between a symbol defined in the Win32 API header files and one defined in the System::Runtime::InteropServices namespace. After some searching around on the 'net as well as some experimentation, I came with the solution I posted immediatly in reply to the original poster in this thread, and it seemed to fix the problem.
|
|
|
|
|
Before the using namespace lines, insert #include<windows.h> .
That should get rid of the "ambiguous symbol" error.
However, if you than get anything such as "CreateDirectoryA is not part of System::IO" type errors (as I gotten when I encountered this same situation), then immediatly after the #include <windows.h> line, add any necessary #undef 's, such as #undef CreateDirectory in my case.
Thus, your example would look as follows:
<br />
#include <windows.h><br />
<br />
<br />
using namespace System;<br />
using namespace System::Runtime::InteropServices;<br />
<br />
namespace WavAPI<br />
{<br />
[DllImport("winmm.dll")]<br />
extern "C" bool sndPlaySound(String* lpszSound, unsigned int fuSound);<br />
}
That should hopefully "fix" the problem.
|
|
|
|
|
How can you make a public function in a class non-inheritable while others are inherted.
Pradeep Niranjan
|
|
|
|
|
Couldn't you mark it as __final or something like that?
|
|
|
|
|
Hello Gurus,
I am writing an AutoRun.exe for my CDs/DVDs. I am not that familiar with C++/VC++ environments. How can I reference "SYSTEM32.DLL" and use function "GetPrivateProfileString()"? Prefer in C++/VC++ 7 & Unmanaged Code.
I am trying to avoid .NET FrameWork dependencies because not every machine loaded with .NET FrameWork. Any input is greatly appeciated. Wish you a happy & thriving 2005.
Khang
|
|
|
|
|
I only have VS 2005 on this machine so i will try to remember. You should be able to look at the help for GetPrivateProfileString() and see what header it is defined in. If you include that header you should be able to use the function. make sure that you do not turn off the standard libs getting linked in.
And this question would have probably have been answered faster in the Visual C++ forum and not in the Managed C++.NET one since you are trying to stay away from .NET.
Steve Maier, MCSD MCAD
|
|
|
|
|
hi,
i did like to get some suggestions on how to sync video playback on different machines!?
lets say i have connected 4 pcs via ethernet and each of them should play a part of a video at the same time...how can i achive that they stay frame sync all the time?
i know that i can select the audiocard on each machine to be the reference clock! but this doesnt help when using multiple machines!
any ideas are welcome
thx & greets
Natarius
|
|
|
|
|
How is this a managed C++ question ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i couldn't find a directx forum...and as i am programming it with managed c++, i posted it here!
|
|
|
|
|
Oh, OK
Most posts in this forum are not to do with MC++. Why did you use MC++ ?
What are you using to play videos ? DirectX ? Windows Media Player ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i am planing to use the vmr9 from directshow
|
|
|
|
|
Don't. The latest version of DirectShow is full of bugs. I've written an article on CP, listing the ones I've found, other people seem to keep adding them.
I ended up rewriting my app to use Windows Media Player.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i need to do video mixing....so i dont have much possibilitys!
so, how would you sync videos over multiple machines??
|
|
|
|
|
Dunno. I synched them across multiple instances of WMP on the one machine by setting up a timer that checked if they were more than a given distance appart, then I reset the position of the player that wasn't playing audio. Doing it across multiple machines presents problems with that approach, if the machines are all also playing the audio.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
only one machine would be playing audio! so thats no problem!
i thought of it too, to sync them manualy with a timer! but i have no idea how this will work over network! what latency does an winsock connection produce on a local network?
if it is that high that it causes problems, how to measure the latency so i can compensate??
natarius
ps: i was not planning to use manged dx...cause the video/audio part of it sucks!! i would use the interop way to access the vmr9
|
|
|
|
|
I doubt the latency would be noticable, but you could send info about when the reading was taken, then the only problem you have is syncing the machines clocks.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hmmmm....another possibility could be to sync the audio cards of the machines digitaly (via spdif) and to make the audiocard the reference clock for video!! that way video should be always in perfect sync!
what do you think??
|
|
|
|
|
Sounds good to me
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
Hello everybody!
I have a question. Anybody knows why managed function calls faster in MC++ rather than unmanaged function (defined with #pragma umanaged )? The differences is about 4 times slower.
Thanks for your answers!
Z-Mechanic.
|
|
|
|
|
If you are compiling a managed application, any unmanaged code, is handled by the Interop Marshaler. It makes a number of additional operations to make the coding of the application appear seamless. Actually, it creates data buffers and loads your data, copying the data to other buffers and casting to compatible .NET types. I'm simplifying a little. But, it's much slower, especially if you have alot of data to transfer.
|
|
|
|