|
as a response to my question:
the C++ module needs to be build in release mode with "multi threaded debug dll" option otherwise it does not work.
|
|
|
|
|
How are you marshaling System::String to std::string?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
|
First I have to apologize for my bad english.
I now working as a audio/graphics programmer for my professor.
My past project is a game/speech recognition program that use following library.
- the launguage used is c++ (vc++ 6.0)
- MFC (for database front end / GUI)
- OpenGL (for 3d graphics rendering)
- ADO (for MS ACCESS database programming)
- port audio (for audio capturing)
which is working fine ,but lately my clients request something that not easily implement in MFC (compare to what I have done in c#) like On the fly dialog font changing , heavily dialog/control skinning .
So is it a good Idea to learn c++/cli ? Since I really want to use those
simple GUI implementation method in .NET but still want to use old c/c++ library
Some questions :
1.is it possible to use unmanaged c++ class/object in managed scope ?
2.Is there a built in audio capturing in .NET library ?
3.does .NET natively support UNICODE ?
4.any other suggestion ?
Thank in advance
|
|
|
|
|
xanagan666 wrote: 1.is it possible to use unmanaged c++ class/object in managed scope ?
I think so, but I would try and avoid it; working with .NET objects is easier for me.
xanagan666 wrote: 2.Is there a built in audio capturing in .NET library ?
Don't know. Maybe in DirectX?
xanagan666 wrote: 3.does .NET natively support UNICODE ?
Yes, alls its chars and strings use it all the time.
xanagan666 wrote: 4.any other suggestion ?
You can convert unmanaged C++ code to managed C++, don't know how difficult that is
(my experience is mainly with C# and unmanaged C, interfaced thru P/Invoke).
You can mix managed C++ and C# (but not in the same DLL), so if you succeed in
encapsulating your existing C++ code, you could do the new stuff (such as GUI) in C#
if you prefer that.
|
|
|
|
|
Thank for your reply.
Converting library from c/c++ to managed code will be out of question Since it very complex (for me) and written by my professor who never work with .NET environment.
The library also devolop in c/c++ for portibility.
If .NET is not an answer , may be I will try to find other
free-native-GUI library that easy to work with.
Any suggestion ?
|
|
|
|
|
I have used C++/CLI, native C++ and C together in many projects. Since you have some native C++ and C# experience, that is a plus. However, there are a lot of gotchas when mixing managed and unmanaged code.
xanagan666 wrote: 1.is it possible to use unmanaged c++ class/object in managed scope ?
Yes! Unmanaged C++ in an assembly is private. So, manage languages, including C++/CLI, cannot see the code via an assembly. Also, you can wrap unmanaged classes within managed C++/CLI classes. You have to be very careful with unmanaged resources, however.
xanagan666 wrote: 2.Is there a built in audio capturing in .NET library ?
Sorry, I do mostly systems programming.
xanagan666 wrote: 3.does .NET natively support UNICODE ?
UNICODE is supported and used by default.
xanagan666 wrote: 4.any other suggestion ?
Here are some books that are quit helpful:
C++/CLI: The Visual C++ Lanuage for .NET, Gordon Hogenson
---This is kind of a C++/CLI Primer
C++/CLI in Action, Nishant Sivakumar
---Good book to have for managed and unmanaged programming
Expert C++/CLI: .NET for Visual C++ Programmers, Marcus Heege
---Advanced managed and unmanged programming
Pro Visual C++/CLI amd the .NET 2.0 Platform, Stephen R. Fraser
----Teaches C++/CLI usage with the .NET Framework
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thank everyone for your suggestions .
|
|
|
|
|
i have a file which contains some records. now i need to pick up one particular record and pass it. how do i do that. now i am hardcoding the value. there is a descroiption for this value. i need to search for this description and pass the value. how do i do that?
|
|
|
|
|
Normally, if you save records to a file. Each record will have some kind of key to be used to find a certain record. If you are looking for information without a key, you will need to read each record using .NET IO classes and match the "description" using .NET string functions (You are using C++/CLI aren't you).
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hi
i need to write some data into CD, by C++ programming
is there any windows API ? or any thing to do ??
and i also validate the size of the DISK befor i write..
how can i do that??
thanks
|
|
|
|
|
Of course your choice for ask this question was wrong you must asked on the Visual C++ but anyway see this[^] article.
|
|
|
|
|
Hi all
After I converted my file from bmp to gif format image then ,an attempt to compile, and the next compilation error merged:
"error RC2170 : bitmap file res\btn_accept_regular.gif is not in 3.00 format"
Any body has a clue abut this error? MSDN gives nothing usful!
|
|
|
|
|
Hi,
1.
Google knows about RC2170 (both resource compiler errors and khaki shorts)
2.
how did you convert from bmp to gif? why didn't you use your own .NET app for this, that would
ensure the same or other app would later understand the gif file.
|
|
|
|
|
hi,
i am developing a program which uses non-unicode character set. hence the language is not English, i should change the system setting in "Regional and Language Option" by fixing "Language for non-Unicode Programs" parameter.
how can i do this setting programmatically or via installer (msi file)?
thanks.
Hamid
|
|
|
|
|
Hi,
Sorry, I don't know and I even do not want to know.
Regional settings is where the user, a human being, tells the system his preferences,
a program should never change those. It is up to the user to choose a language, a currency,
a date and time format, etc.
|
|
|
|
|
Hi All,
I've got the following code (it's been abbreviated to simplify the discussion). I'm getting a byte order swap. How do I avoid it? Casting gives no joy, since these are cast to void* by memcpy().
byte ctr[ AES::BLOCKSIZE ];
memset( ctr, 0x00, sizeof( ctr ) );
int pos = 12;
int t = 0xAABBCCDD;
memcpy( &ctr[ pos ], (byte*)&t, sizeof( t ) ); I expect ctr[12]=0xAA, ctr[13]=0xBB, ctr[14]=0xCC, ctr[15]=0xDD. However, it's reversed: ctr[12]=0xDD, ..., ctr[15]=0xAA.
Can anyone explain the behavior? I sure did not expect it.
Jeff
|
|
|
|
|
This does not look like C++/CLI to me. It looks to me like you want the visual C++ forum.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chrisitan,
Christian Graus wrote: This does not look like C++/CLI to me.
It's clearly not a Visual C++ question. C++/CLI seems most appropriate. What do you suggest?
Jeff
|
|
|
|
|
Hi Chrsitian,
My apolgies. Chris did state this is a Managed forum. Hopefully next he will change the name of Visual C++ to C++\Visual C++. That will probably stop the extraneous posts.
Looking at the group layout, the following would probably better align the forums:
C++\STL
ATL\WTL
Managed C++\CLI
Visual C++\MFC
Jeff
|
|
|
|
|
Hi Jeff,
you must be running on a "little-endian system" (LE) such as an Intel x86; this means values get
stored with their least significant byte at the lowest address.
Other processor families such as PowerPC are "big-endian" )BE) and store the most significant byte
"first", i.e. at the lowest address.
It is just a convention, and yes BE seems the more natural one.
The byte order does not matter much in most circumstances; it does when exchanging data:
- through files, following some convention, so they can be exchanged all around;
- through networks (e.g. Ethernet packets)
- with a specific hardware interface
A byte swap is a costly operation.
The IPAddress class offers some methods that may interest you.
[added]
To swap with your own code, the easiest I could ever figure was using a union between
your type and a byte array (write the type's value, swap the bytes in the array, read the type).
But now some languages don't support that very well (C#, Java).
[/added]
modified on Saturday, December 15, 2007 10:33:56 PM
|
|
|
|
|
Hi Luc,
Thanks. What I don't understand is why _both_ sides of the equation do not exhibit the behavior. It seems only the right hand side does.
For example, imagine a world where:
int a, b;
memcpy(&a, &b, sizeof(a)); results in an endian swap. This should be equivalent to
a = b but it is acting more like
a = ENDIAN_SWAP(b)
Jeff
|
|
|
|
|
Hi Jeff,
memcpy (or code that you would write yourself using two byte pointers that autoincrement)
just moves bytes, one after the other; it does not swap bytes, it does not understand or care
about the meaning of those bytes. It is just a physical operation on memory, as it name implies.
And all is fine as long as the two pointers have the same type.
But then the semantics of your data may kick in:
Multibyte integers need a byte order convention, that is what big and little endianness is about.
If you memcpy using two pointers of different types, you may get a surprise, since now the
first byte of a byte array is the one with index 0, whereas the first byte of an integer may be
the most significant (BE) or the least significant (LE) byte of that integer. And the same holds
true for floats.
So if you suspect memcpy of swapping bytes, you are basically saying that you are:
- mixing pointer types
- running on a little-endian processor
- but in favor of big-endian
|
|
|
|
|
Dear Sirs,
I Use Splitcontainers in my form
On the right side , I need to add many User control I create.
How can I add it to my Forms manuelly or programmatically
|
|
|
|
|
Assuming this is really a C++/CLI question, just add them to the Controls collection of your form.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|