 |
 | The C++ / CLI is for managed and mixed-mode C++ programming only |  | Chris Maunder | 10:36 9 Jan '06 |
|
 |
This message board is for managed and mixed-mode C++ programming only: Managed C++ in VC++.NET or C++/CLI in VC++ 2005. Please post all standard C++ programming questions in the Visual C++ board[^].
cheers, Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
 |
 | Finding and mapping audio devices in windows |  | gurindersm | 2hrs 6mins ago |
|
 |
Hello All
I have two USB audio devices attached to the system. Using API's "SetupDiEnumDeviceInterfaces" and "SetupDiGetDeviceInterfaceDetail" I am able to figure out their unique device paths which is in this format "\\?\hid#vid&pid&col02#7&1bca1430e&0&0001#{some id}" "\\?\hid#vid&pid&col02#7&3db23aebe&0&0001#{some id}"
Also on using the API "waveInGetDevCaps" I am able to find out the unique strings the system is using to identify this device which are "USB Headset" and "USB Headset (2)", my question is how can i know from my application which "USB Headset" is linked to the which of the above mentioned path. Or is there a way to map the audio devices listed in “Sound and Audio Devices” settings with the actual hardware programmatically.
Any input is greatly appreciated.
OS (2000, XP, Vista), VS2005 ( VC++ IJW )
Thanks gsm
|
|
|
|
 |
 | Exposing a property of a nested class to .Net VB, C# etc. |  | stempsoft | 7hrs 58mins ago |
|
 |
I have a nested managed class and I would like to expose the properties of the nested class to C# and VB. How do I do this?
In the following C++ managed class, I can see all of the properties of FitnessUserProfile in VB. I can see the Activity class within the FitnessUserProfile object in VB but I can't see any FitnessUserProfile.Activity properties.
What am I doing wrong?
I am using Visual Studio 2005.
namespace GarXface {
public ref class FitnessUserProfile : public ICloneable {
public: property unsigned BirthDay { void set(unsigned day) { m_pProfile->SetBirthDay(day); }
unsigned get() { return m_pProfile->GetBirthDay(); } }
ref class Activity : public ICloneable { internal:
Activity(void);
public: property float MaxHeartRate { void set(float heartRate) { }
float get() {
}
}
|
|
|
|
 |
|
 |
stempsoft wrote: ref class Activity
Make the nested class public. So it can be accessed by FitnessUserProfile::Activity . BTW, why are you exposing nested class?
|
|
|
|
 |
|
 |
Thanks but I have it working now. Not sure what I was doing wrong before.
And why wouldn't I expose a nested class? Activity is only useful within FitnessUserProfile.
Oh and you advice was wrong it generates an error:
Help file says the following:
When applied to a managed type, such as class or struct, the public and private keywords indicate whether the class will be exposed through assembly metadata. public or private cannot be applied to a nested class, which will inherit the assembly access of the enclosing class.
When used with /clr, the ref and value keywords indicate that a class is managed (see Classes and Structs (Managed)).
|
|
|
|
 |
|
 |
stempsoft wrote: Oh and you advice was wrong it generates an error:
Then you are doing it incorrectly. See the following code which will execute without any errors. It show how a method declared in nested class is accessed from outside.public ref class Outer { public: ref class Inner { public: void SayHello() { Console::WriteLine("Hi from inner"); } }; }; You use it likeOuter::Inner^ inner = gcnew Outer::Inner(); inner->SayHello(); Does that help?
|
|
|
|
 |
 | which is the best method to send data to clients, without a request from client |  | naveen_bij | 21hrs 45mins ago |
|
 |
i am developing a application which has got a admin module and a user module, admin module will be running on only one machine, but the user modules will be running on multiple systems. i have got some settings to be done in admin module and the same settings should be used by user module also, how to get the settings in the user module from the admin machine. whenever any settings are changed in admin module all the user modules should get the new settings.
Naveen
|
|
|
|
 |
|
 |
naveen_bij wrote: which is the best method to send data to clients, without a request from client
If the clients are not going to make a request then they have to listen or poll for the data. It's not the best method, it's the only method left after you eliminate requesting data. Essentially there is little difference between the two.
|
|
|
|
 |
|
 |
thanks for your response. so i have to write a listener event in my application. Currently i don't know how to do it, but will try to do that and if any problems will get back for your help
Naveen
|
|
|
|
 |
|
 |
Hi,
I wouldn't try and push the data from server to client; just have one of these: - have the client ask whether new admin data is available at the start of a new session; - or have the server respond with a specific error code rather than real data whenever it feels the client should get new admin data first.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
 |
|
 |
thank you sir, i thought of using UDP multicasting, where all the clients join a group and server sends a datagram to that group. so i will send a error code to the group stating that new settings are available, when the user modules receive this message they have to complete and stop all the other processes and get the new settings, because the settings are used in other processes. can u please guide me how to do it in a better way
Naveen
|
|
|
|
 |
 | Assenbly referencing problem |  | KASR1 | 20:00 11 Feb '09 |
|
 |
I am new to C++/CLI. Tried to reference a dll from VC++ project with Common Language Runtime Support (/clr).
I am getting the below error message when running application.
"An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module."
What could be the problem?
|
|
|
|
 |
|
 |
KASR1 wrote: I am new to C++/CLI.
What else are you new to, programming?
KASR1 wrote: "An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module."
What could be the problem?
Yes indeed, what could be the problem, try clicking on this link[^]
|
|
|
|
 |
|
 |
Are you making fun! I have tried searching Google and most of them were not specific to my problem. So we posted it here.
For getting quick solution only we are posting here. Not to make fun!
Kindly give us the solution if you know or dont post a reply like this!
|
|
|
|
 |
 | please help me to work folderbrowser dialog in asp.net |  | sivasampathkumar | 23:09 10 Feb '09 |
|
 |
I am working on asp.net using c# I am working on folderbrowserdialog I got an exception
>"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
|
|
|
|
 |
|
 |
This is the "Managed C++/CLI" forum! Please post this question in the ASP.NET or C# forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
 |
 | Declare an array of structures containing an array into a Form's class. |  | chaloens | 6:46 10 Feb '09 |
|
 |
Hello,
I'm totally new on Managed C++ and I'm creating an VS2005 C++ application on which I need to keep information for logging purposes.
The data I need to store would have been saved in the old days in a structure like this:
struct tDataEntry { unsigned char data[8]; long id; unsigned int length; unsigned int flags; unsigned long time; };
Being a newbie on this I immediately started getting compiler errors like "cannot define 'xxx' as a member of managed 'XXX': mixed types are not supported", so I read a little bit about Managed Code, Mixed types, the GC, etc and I searched the web for an example that could help me out but couldn't find it.
I found some articles that were close to my problem where they suggested using templates to embed a native class in a ref class but when I added the extra complexity of the arrays it just didn't work.
Anyway, I need to be able to declare a fixed size tDataEntry array in my Form class so I can fill the elements, format the information, show it, etc.
Any help on this will be appreciated!
Thanks, Chalo
|
|
|
|
 |
|
|
 |
|
 |
Mark Salsbery wrote: It may help to read a little bit more
NO WAY! We write code! We don't need no stinkin readin!
|
|
|
|
 |
 | C++/CLI Beginner Questions |  | TripShock | 4:07 10 Feb '09 |
|
 |
ref class A { ... };
int main() { A objA;
return 0; }
I thought we were not supposed to be able to use ref classes that way...only through tracking handles and tracking references. The above code compiles and runs. Could someone please explain it to me?
|
|
|
|
 |
|
 |
TripShock wrote: Could someone please explain it to me?
They implemented stack semantics[^] in C++/CLI
|
|
|
|
 |
|
 |
Why is it that I can't do this:
String yo;
|
|
|
|
 |
|
 |
From the docs[^]:
The following reference types are not available for use with stack semantics: *delegate *array (Visual C++) *String
Mark Salsbery Microsoft MVP - Visual C++
|
|
|
|
 |
|
 |
Welcome to CodeProject 
TripShock wrote: Why is it that I can't do this:
Because you need to do this:
String^ yo;
That said, if you had spent like 10 minutes reading any of the tons of beginner material here on this site and all over the internet related to the CLI subject, you would already know that. 10 minutes rather than the 3 hours you have waited for an answer from an internet forum.
10 minutes or 3 hours, you decide.
|
|
|
|
 |
 | Advice for remote dabase.... |  | Thilek | 1:31 10 Feb '09 |
|
 |
hi guys,
i am creating a VC++ program that connect to mysql database on remote server.i have tried few steps but it didnt work.i need advice on which database i should use and it must be in a remore location.
i create a mysql database on speedhosting.co.cc but its a database for php. Is it possible for a C++ program connect to it and get data from there ??
|
|
|
|
 |