|
Hello,
Is there a way to display a custom image within a messageBox? Traditionally you would load custom text, but what about an image?
Thanks in advance!
Mr. O
|
|
|
|
|
I suspect you'd just create your own form and show it instead.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
This[^] article may help.
/ravi
|
|
|
|
|
I think you must create ur own form.give same appearance as message box.make some setting changes. allow user to give image filename in some custom property.
Regards
Chintan
www.visharadsoft.com
(Nothing is so purify as KNOWLEDGE)
|
|
|
|
|
C# codes on how to connect to a Access database stored in C:\my documents\mydatabase.mdb
|
|
|
|
|
|
|
Convert ? No. Create an image and draw the path onto it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
sorry, second post tonight, i feel like i'm flooding this board !
This is probably going to sound really stupid: Is a .dll file just a class?
Is it possible to browse the .dll file and see what Methods is provides?
BACKGROUND :
I just saw how to make my computer Beep via P/Inovke using the following code:
<br />
[DllImport("kernel32.dll")]<br />
public static extern bool Beep(int freq, int duration);<br />
From what i gather, we need to go via this route because the .NET doesn't provide
functionality for sound. What i'm thinking now is that there must be loads of other things
that the .NET can't do and how would i go about finding out what else is out there? (other than having been a programmer since before the .NET )
I tried adding a reference to the kernel32.dll, with the mind that then i might be able to 'view it's contents' using the object-browser but i got an error.
Thanks ..
|
|
|
|
|
Ylno wrote: sorry, second post tonight, i feel like i'm flooding this board !
LOL - that's hardly flooding.
Ylno wrote: From what i gather, we need to go via this route because the .NET doesn't provide
functionality for sound
Not entirely true, I thought .NET 2.0 had some sound functionality, to play wave files at least. And you can play most file formats with the media player control. It *is* true that p/invoke is the way to call APIs that give you things .NET does not.
Ylno wrote: I tried adding a reference to the kernel32.dll, with the mind that then i might be able to 'view it's contents' using the object-browser but i got an error.
You can only do that with .NET dlls. p/invoke is for dlls that are not.
A dll is a bunch of code without an entry point, basically. www.pinvoke.net[^] provides signatures for calling lots of Win32 API methods and probably comes close to giving you a complete list of what's in those dlls, and what they are called.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Cheers Christian,
That is exactly what i wanted. Thanks !
One thing :
Christian Graus wrote: A dll is a bunch of code without an entry point,
I guess your referring to the Main() method. Does this mean basically that these files have usable code within but not are not in themselves excecutable?
Are the .dlls be written in C ? if so would that mean that their code could be viewed in a C compiler?
|
|
|
|
|
Ylno wrote: Does this mean basically that these files have usable code within but not are not in themselves excecutable?
Some dlls just contain resources. Most contain code, but no way to execute that code, nothing that can run without being called. So, they contain typically libraries that you reference and call from your main program.
Ylno wrote: Are the .dlls be written in C ?
Yes, in this case.
Ylno wrote: if so would that mean that their code could be viewed in a C compiler?
No, C# and VB.NET are different to C, C compiles down to machine code and cannot be decompiled to readable code, at least not in the way that .NET code can.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you again,
You've cleared somethings up in my mind.
|
|
|
|
|
I tries to open file big than 2^32 bytes. it's not working because it pass the maximum addressing in the memory and it stucks the computer. is there a solution for that problem??????
|
|
|
|
|
There should be no problem opening the file. Are you saying that you are trying to read the entire file into memory?
If so, then the solution is simple: Don't. Just read the part of the file that you are currently working with.
---
single minded; short sighted; long gone;
|
|
|
|
|
>4GB?? You're never going to read the entire file into memory. You have to process it piece by piece.
|
|
|
|
|
As long as you're running NTFS, you should be able to open the file. You can't read it all into memory, of course; that's what FileStream [^]is for: read in small chunks at a time.
|
|
|
|
|
computer cannot run this line if i try to open file bigger than 4GB
fs = File.OpenRead(path)
but the question, how can i open it in pieces?
|
|
|
|
|
I just read an article on parsing in c# and they said that unlike older languages, parsing in c# in simple terms, for a beginner, can be a nightmare.
All I want to do is store room descriptors in a text file with a dillimeter and a value.
- The first value is used to find the correct line to print. e.g 01
- The second part being the name of the room, or unless its the rooms look value, e.g 011
- The third part being the description of your initial impression before looking closer.
Data in the text file...
01,WestHall,The room is filled with old pottery and cobwebs.:
011,Searching the room you notice a hole where a key might fit.:
02,EastHall,Several torches line the walls, and a chest rests upon a stone slab in the back.:
021,Searching the room you notice the flames on the torches are not moving, almost as if...:
Is it possible to pull this data out in chunks using StreamReader?
Unless... I just thought of something as I write this very moment.
Can I say...
ReadToEnd, this entire text file and say drop it in to a string variable.
Then from their use some sort of character searching in the string?
Thanks for your help ahead of time.
|
|
|
|
|
jblouir wrote: they said that unlike older languages, parsing in c# in simple terms, for a beginner, can be a nightmare.
Written by a moron then. The string class in C# has similar methods to CString in C++, it's at least as good as that class. It can be difficult to learn regex, but that's a moot point. You don't have to use regex, and if you do need it, it's wonderful that it's there.
jblouir wrote: All I want to do is store room descriptors in a text file with a dillimeter and a value.
The string's split method will let you take a line and turn it into an array of strings, with each string being one of your values.
string [] lines = File.ReadAllLines(@"c:\file.txt");
foreach (string line in lines)
{
string [] elements = line.split(new char [] { ',' } );
if (elements.Count > 0)
{
int n;
if (int.TryParse(elements[0], out n))
{
// the first element was a number, now stored in n
}
}
if (elements.Count > 1)
{
// process elements[1], which is WestHall in the first instance.
}
// etc.
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Damn, you beat me to it! Frickin' router problems!
|
|
|
|
|
ROTFL - you're usually the one who beats me :P
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
jblouir wrote: I just read an article on parsing in c# and they said that unlike older languages, parsing in c# in simple terms, for a beginner, can be a nightmare.
Anything for a beginner is a nightmare, until they learn it's really very easy! I have no idea where you read that, but stop.
jblouir wrote: Is it possible to pull this data out in chunks using StreamReader?
Sure. But, you don't have to use ReadToEnd. Just read a line of the file (StreamReader.ReadLine), split the line on your delimitter (String.Split) to get the string values in an array, then process the first item in the array. That will tell you how many more items there should b in the array and what to do with them. Read the next line in the file. Rinse and Repeat.
|
|
|
|
|
The other responses are correct, but have you considered using XML?
|
|
|
|
|
I am trying to start with basic stuff, instead of jumping into 2d/3d graphics and using databases, so im just making a text adventure (In console) with simple data files for storing data, I might use serialisation for saving the game state(save games).
After that then ill move up to the fancier code. )
|
|
|
|