|
Fritzables wrote: despite the fact I have tried a number of times creating different search strings
That is easy to believe. Keep at it though. Developing the "skill" to find information is a critical skill in our field. If this helps at all, I use Google to do my searching and when I expect that MSDN will contain the information I seek I put "MSDN" as the first keyword in the Google search phrase. I find that Google provides much better results than the MSDN search engine. But that's just me.
Anyway using your question as an example my Google search string would be
MSDN System.String convert WCHAR
Try it out.
led mike
|
|
|
|
|
I hope this example helps:
#include <iostream>
using namespace System;
using namespace System::Runtime::InteropServices;
int main(array<System::String ^> ^args)
{
String ^gcString = L"Hello, World!";
IntPtr intptr = IntPtr::Zero;
try
{
intptr = Marshal::StringToHGlobalUni(gcString);
const wchar_t *hgString =
static_cast<const wchar_t*>(intptr.ToPointer());
std::wcout << hgString << std::endl;
}
catch (Exception ^e)
{
Console::WriteLine(e->Message);
}
finally
{
if (intptr != IntPtr::Zero)
{
Marshal::FreeHGlobal(intptr);
}
}
return 0;
}
-- modified at 19:20 Wednesday 29th November, 2006
|
|
|
|
|
I use this easy way, but it is not recommended for large strings.
String ^s = "Hello world";<br />
CString str = s;<br />
WCHAR *w = str.GetBuffer();<br />
WCHAR *myChar = new WCHAR[str.GetLength() +1];<br />
memcpy(myChar,w,str.GetLength()*sizeof(WCHAR));<br />
myChar[str.GetLength()] = '\0';<br />
<br />
AfxMessageBox(myChar);
|
|
|
|
|
Thanks all for the help on this one - much appreciated.
Fritzables.
|
|
|
|
|
Can anyone tell me the difference between Storage Class and Storage Class Specifier?
Thanks and Regards
Kenny
|
|
|
|
|
In C++, the storage class specifiers auto, static, register, extern, and mutable. The storage class specifiers explicitly determine the storage class of a variable. Thus, the storage class specifier, auto, lets you define a variable with automatic storage (storage class). However, you will also hear: auto storage class. So, storage class and storage class specifier may be used to mean the same thing.
|
|
|
|
|
i need creating a database myself,i need make a database from scratch , can u give me some help please?
ert
|
|
|
|
|
According to your profile, you program with C++ and not C++/CLI. Also, your plea for help does not give me enough information to assist you. What are your requirements? Here is an example of how your plea for help sounds to me:
I need to create a vehicle from scratch? Can you help me?
|
|
|
|
|
George L. Jackson wrote: Here is an example of how your plea for help sounds to me:
I need to create a vehicle from scratch? Can you help me?
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
There is a c++ application developed in Windows Platform. Now I want to
port this application in to Linux (Red Hat - Fedora Core). Is there any tool for converting it or can anyone suggest the way to convert it. I am totaly new to Linux and doesn't famliar with compiling multiple sourc files. Actually there is around(180 Files - including headers and cpp files), its a project and i want to convert it. can anyone help me in this.......
Thanking you....
Syamkumar.P.J
syamkumar.
|
|
|
|
|
I think you are in the wrong forum...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
You might be able to run it with wine program in Linux. Your better bet would be to ask in a Linux forum
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|
|
Hi ,
My problem is that, I want to run an .exe from the windows service. But the application window is not visible to the user. Exe and Service is running in task manager. Previously I was using CreateProcess funtion. Then after getting suggestion from this site, I changed that into CreateProcessAsUser and the Code is like below. But Still I am facing same problem.
BOOL b;
HANDLE hToken;
HANDLE hNewToken;
b = OpenProcessToken(GetCurrentProcess(), TOKEN_ASSIGN_PRIMARY|TOKEN_DUPLICATE, &hToken);
b = DuplicateTokenEx(hToken, TOKEN_ASSIGN_PRIMARY|TOKEN_ALL_ACCESS, NULL, SecurityImpersonation, TokenPrimary, &hNewToken);
b = CreateProcessAsUser(hNewToken, NULL,ArgPBU,NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS | CREATE_NEW_CONSOLE, NULL, Cwd, &si, &m_piPBU);
CloseHandle(hNewToken);
-------------
After executing this I am getting same result.
Rgds.,
N.Surendran
|
|
|
|
|
Does your service have a main or a WinMain entry point? Also, you should post this in the Viaual C++/MFC forum.
|
|
|
|
|
i'm new in C++ but i'm a Borland C++ user, is that same with C++/CLI ?
Can anyone help me make bouncing ball with the Borland C++ program ?
i beg all the readers
thanks before
|
|
|
|
|
Borland C++ is not managed. C++/CLI is managed. Thus, you are in the wrong forum. Also, you may have better luck asking your question at a Borland C++ message board.
|
|
|
|
|
Hello,
I am trying to do a GetPixel in a image embebed in a PictureBox.
If I have a Bitmap it is posible to do a GetPixel, to get the COLORREF of the pixel clicked, but in a PictureBox I can't do it.
Does anybody knows how to get the color of a pixel clicked in a picturebox?
Thanks in advance
|
|
|
|
|
A picture box is NOT a picture. It DOES have a property that exposes the bitmap it's displaying. I presume you can call a getpixel method on that.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Ok, now I see,
I have done it as follows:
I load the image in the picturebox:
pictureBox->Load("C:\\image.png");
and after I load it like a bitmap in the event that I want, in my case pictureBox_MouseUp
<br />
Point^ Point1;<br />
Bitmap^ Bitmap1;<br />
Color pixelColor;<br />
<br />
Point = e->Location::get()<br />
Bitmap1= gcnew Bitmap( "C:\\image.png",true );<br />
pixelColor = Bitmap1->GetPixel(Point1->X,Point1->Y);
This is the way that I did it,
Thanks for your help
|
|
|
|
|
I'm not sure how this is a C++/CLI question ?
Christian Graus - C++ MVP
|
|
|
|
|
I wana make so many lines appear randomly (like heat beat rate) depend on the base line ..while I run the program .
How can i make that works . pls give me some hints or code ,,
|
|
|
|
|
Which bit are you stuck on ? Are you really using C++/CLI, or are you in the wrong forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I recently downloaded Visual C++ Studio and when I try to compile my project, I get error messages such as these below. I made sure to follow the instructions on setting the VC++ Directories option but I still keep getting errors such as this one
c:\Pam 2\Headers\afxwin.h(19) : fatal error C1083: Cannot open include file: 'AFX.h': No such file or directory
and the problem is that most of these include files happen to be in the Windows Platform SDK / Include/MFC folder. How do I get my the compiler to look in there for these files please.
|
|
|
|
|
First of all, you're in the wrong forum.
You set the paths in the options for VC2005.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You have downloaded Visual C++ Studio? I think it is VC++ Express edition, which does not support MFC. (Afx.h). You need to retail version to do MFC programming. The express edition only supports Managed c++.
|
|
|
|