|
Check out the tutorials at Nehe. They're pretty good, and C# source code is included for most tutorials...
Standards are great! Everybody should have one!
|
|
|
|
|
..Nehe is maintained by gamedev.
...what implementation of the OpenGL spec are you using? ...Which spec does your implementation build off of? Are you using Mesa? Glut? CsGL? ...Try going to opengl.org. There should be information in their wiki as well as getting started information
Welcome my son...Welcome..to the Machine
|
|
|
|
|
Is there a routine in C# that can be called to obtain a randowm number?
I am attempting to name many files with unique names. Do not want to use a counter writing to disk each time. Does anyone know of a unique number random generator in C#
|
|
|
|
|
System.Random
Though I don't believe this will work for your application as depending on the number of files and seed value, the possiblity of getting the same random number is likely.
System.IO.GetRandomFileName may be better in this case.
only two letters away from being an asset
|
|
|
|
|
I will try to use System.IO.GetRandomFileName
have a question though... will this be truly random, and not repeat at least within a large number of files generated , like maybe, every 1000 files names?
|
|
|
|
|
the next number after 13 in a truly random sequence can well be 13 again. If not,
it would not be a truly random sequence.
For non-conflicting filenames, you MUST include a trial-and-error loop, since
whatever scheme you come up with, the filename you generate may already exist.
|
|
|
|
|
In order to use GetRandomFileName, do i have to use anything but System.IO?
It says it is not a member.
If i do System.IO.GetRandomFileName OR Path.GetRandomFileName
|
|
|
|
|
This available only in 2.0 and higher
only two letters away from being an asset
|
|
|
|
|
maybe a GUID[^] is what you're looking for
|
|
|
|
|
System.IO.Path.GetTempFilename[^]
This returns the full path in the user temp directory, though, so it may not be what you are looking for.
-----
Formerly MP(2)
If atheism is a religion, then not collecting stamps is a hobby. -- Unknown
|
|
|
|
|
why are you creating random numbers
why dont you take an interger and increment it every time for every time the file name already exists
if you are dealing with larger number of files prefix or suffix ddmmyy to that number
Regards
Amar
It is Good to be Important but!
it is more Important to be Good
[My Question]
|
|
|
|
|
I'd concur with an earlier poster, use a GUID. In my experience the System.Random class isn't all that random, at least so far as generating 1000's of numbers a minute, unless you provide a good variation of seeds.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
I am generating file names could be anywhere from 5 to 1000 in say 5 minutes or less. Just want to have unique names. Do not want to write to disk and increment numbers. Someone suggested that i use GetRandomFileName, but that does not seem to be able to build. Am i missing something?
|
|
|
|
|
Maybe i can datetime stamp the file to the millisecond.
What is the best class to use for that?
|
|
|
|
|
Hi!
My application uses a dll named "GsmCommunication.dll" which needs to be registered before running application. i want to register this dll programmaticlly when application is installed, using regsvr32 or any other command. Some one told me to use
Process.Start("regsvr32", "GsmCommunication.dll");
but it does not work, thats may be because dll is not available in "System32" folder. how can i register dll by giving its current path, i.e. the path in which application is installed..?
Please help me solving my problem...Thanks,
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
You can write a small application that registers the dll you need. The application will run only after installation process. You can get the path of the folder of the application by Application class
|
|
|
|
|
Thnx for reply...can you be more specific about what to write in that small application? i dont have a clue of how to register dll, what classes/functions to use...?
more help please...!
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Use process class to launch regsvr32.exe and specify the path of the dll as an argument to the Process.
|
|
|
|
|
Thnx for reply...
I tried following methods but all gave error:
System.Diagnostics.Process.Start("regsvr32", Application.StartupPath + "\\GsmCommunication.dll");
Error: LoadLibrary("E:\Affan") failed - The specified module could not be found.
System.Diagnostics.Process.Start("regsvr32", Application.StartupPath);
Error: same error as above..
and then after placing GsmCommunication.dll in system32 folder i tried this:
System.Diagnostics.Process.Start("regsvr32", "GsmCommunication.dll");
Error: GsmCommunication.dll was loaded but the DLLRegisterServer entry point was not found. This file can not be registered.
please help!
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: and then after placing GsmCommunication.dll in system32 folder i tried this:
System.Diagnostics.Process.Start("regsvr32", "GsmCommunication.dll");
Error: GsmCommunication.dll was loaded but the DLLRegisterServer entry point was not found. This file can not be registered.
Have you tried registering the dll from command line? Does it work? It seems that your dll can't be registered.
|
|
|
|
|
Hi!
Thanks for reply, i tried registering dll through command line but it gave the same error. may be dll is corrupt...i will try to get its correct version.
Kindly tell me am i using the correct code to register dll and is there any way i can register dll by giving a path other than System32 folder? Because when i try to give a path, wherever a [space] comes in path it considers it as dll name and gives error.
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Affan Toor wrote: Kindly tell me am i using the correct code to register dll and is there any way i can register dll by giving a path other than System32 folder? Because when i try to give a path, wherever a [space] comes in path it considers it as dll name and gives error.
You need to surround the full path with " "
|
|
|
|
|
Giorgi!
Thanks alot, your tip helped me in solving my problem..
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
You are welcome
|
|
|
|
|
Hi!
I have the following problem:
My C# application creates a special file-format, called *.tvp.
When I build my Setup Project, an icons is show symbolizing my program. What I want now is:
All *.tvp files shall show this icon after installing my program as this for example works with *.doc files. They also show the winword icon.
Does anybody know about settings to realize this?
Thanks a lot
|
|
|
|