How on earth do you call them? I've tried all sorts of methods, the latest being MessageBox::Show("Text", "More text"); from a tutorial on the site but I just get compiler errors like MessageBoxA is not a class or namespace name or MessageBox is not a part of System::Windows::Forms (when intellisense tells you it is). The onlt way to do it so far it via #prgama unmanaged void CallMsgBox() { MessageBox(NULL, "Old style msg box", "Caption", MB_OK); } #pragma managed So how do you call it??? Thanks Obseve everything, remember more...
tom76
Posts
-
Messageboxes in managed C++ -
Where can I find details of namespaces?I would like to know of a resource that has details on available namespaces. for example in C++ I'd use iostream.h for i/o operations, but in C# I do not know what I would use (all I know are System and Collections, but no details on the functions within them). Can anyone suggest somewhere? Obseve everything, remember more...
-
The csc.exe compiler - member variablesHey that makes sense. Thanks, I'll refer to what you said while I'm learning C#. Obseve everything, remember more...
-
The csc.exe compiler - member variablesOk I've got it now, they are properties and I access the actual members using them. I saw an example about a Person class, a Name property, and a myName member variable on the MSDN site. I'm not sure why all this is necessary (the best reason I've seen on MSDN is b/c it gives a nice 'clean' look to the code. wtf? Better than Person.mPersonName = "John" - is it not down to how you name your variables?). Thanks to everyone who had a look at this. Obseve everything, remember more...
-
The csc.exe compiler - member variablesprivate int mTinyInt = 1; public int mPubRepTinyInt { get { return mTinyInt; } set { mTinyInt = value; } }
So when I want to use mTinyInt I actually call mPubRepTinyInt. This cannot be right surely - where am I going wrong? Obseve everything, remember more... -
The csc.exe compiler - member variablesDoes the compiler initialise the member variables when the compiler-created constructor is called? For example
class MyClass { public int mTinyInt { get { return mTinyInt; } set { mTinyInt = value; } } } // in code // Create an instance, calling the compiler-created constructor. MyClass MyObj = new MyClass(); // Output varibles to the screen to see what the compiler has done. Console.WriteLine("\n\nThe int values is:\n {0}", mTinyInt);
This however gives me a stack overflow. I would assume that the compiler would make all members 0 in the created constructor, but is this not so? Obseve everything, remember more... -
How do I compile C# ?Thanks Obseve everything, remember more...
-
How do I compile C# ?No, how do I install C# support? Obseve everything, remember more...
-
How do I compile C# ?I have visual studio .NET 2003 but how do I create a project in C# ? If I go to New -> Projects I get all the managed C++ items but how can I create C# projects? If I just create a file, I do not have the option of a .cs file - must I download something or will it compile .cs files as it is? Obseve everything, remember more...
-
Adding your name as author to an exe's propertiesWhen you right click an exe file you get the company's name, I'm wondering how you create this information? I would assume there's a setting in VC++ and studio.NET that compiles this information into the file but I'm not sure where to find this setting. Obseve everything, remember more...
-
Web page memoryI assume you are trying to dynamically change the HTMLView window (the Internet Explorer activeX object you drop onto a dialog in Visual Studio's editor), am I right? Look at how you set the pixels (width and height) and maybe attach a global variable to it, and getting the address of the variable and use it that way... I don't really know, usually I stick to variables and don't bother getting it from RAM in the way I think you want. Obseve everything, remember more...
-
MFC CBitmap LoadBitmap()Okay, but there is a function LoadBitmap() that takes an LPCTSTR string of the name of the bitmap. How does one use it? Obseve everything, remember more...
-
MFC CBitmap LoadBitmap()Hi all, Bit of a problem with CBitmap's LoadBitmap() function. If I make a bitmap a resource and do BitmapObj.LoadBitmap(IDB_MYBITMAP); The image is loaded fine, but if I do BitmapObj.LoadBitmap("MyBitmap.bmp"); it returns 0 (failed). I've tried moving the location of the file around the local directory (debug, res, etc.) but no luck. What do I need to do? Obseve everything, remember more...
-
Web page memoryI think you'll need to be a bit clerer on this question... jeremysay wrote: hello, You know if it is posible to know where are stored in memory the pixels of a web page ? and if yes how ? thx in advance Obseve everything, remember more...
-
Some tips on building a workspace please!Hi all, I've got some files from our source control system, these are .c, .h, .Mak, and a MAKEFILE, and they compile to make a program. My problem is I'd like to put them into a workspace and project, but am stuck on how to do this. Do I create the workspace then create a blank win32 console project, add the files in, and compile that way? I did this, but I get errors (I know the code works) concerning near and far keywords in the files, so I think I need to build according to the MAKEFILE but am unsure as to how to tell visual c++ to do this. Any thoughts? I hope this is clear enough! Obseve everything, remember more...
-
GetIpNetTable and MFC dialogsSorted it - user error I think. I put a watch on m_hWnd and after calling the function it said the expression could not be evaluated. I had allocated the buffer too small so it seems the buffer was overwritten, and the variable m_hWnd was overwritten! Obseve everything, remember more...
-
GetIpNetTable and MFC dialogsI've created an app in MFC that is dialog based, and I call functions such as GetIfTable to retrieve data and display it using SetDlgItemText to pop it into an editbox. However, when I call GetIpNetTable to get a table of Address Resolution Table rows, I immediately lose my m_hWnd member. I've not had this problem with the other functions, just this one. Has anyone come across this problem before? I've looked on google but can't find anything. I've tried creating a dummy HWND and assigning it the value of m_hWnd and then reassigning after calling the function but all I get is an access violation message. Obseve everything, remember more...
-
Can I not use static const when declaring members?I'll try it, thanks. Obseve everything, remember more...
-
Can I not use static const when declaring members?Thanks, I'll have a go at that I think. Still don't know why I am getting these syntax errors though. Oh well. Obseve everything, remember more...
-
Can I not use static const when declaring members?I've not got a definition (.cpp file) for my class, as all I am using it for is to create a static const object with these members so everything is in MyClass.h . I believe I need a global because I only want one instance of this object, because the members will never change value. The errors are error C2059: syntax error : 'constant' error C2238: unexpected token(s) preceding ';' for each member. Obseve everything, remember more...