|
rand function is used in vc++ also.
int rand( void );
Do you include "stdlib.h" library.
Please send your code or error message.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
modified on Thursday, May 15, 2008 4:11 AM
|
|
|
|
|
Please explain me why low score.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Shilpi Boosar wrote: Please explain me why low score.
Actually it did not deserve it. I've balanced.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
ok
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
mihai123 wrote: Have a program in borland C++ and wanted to transfer it in Visual C++ but i got some error.
Oh, you're so informative...
mihai123 wrote: What should I include? Or is there other function that do the work in term of randowm numbers in visual c++ ?
Documentation my, friend, documentation [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Hello all,
My requirement is to place hyperlink in Message Box along with some other message. How could i accomplish this??
Any help is greately apprecited.
Regards,
Hemang
|
|
|
|
|
I don't think you'll be able to put that on a standard MessageBox. Anyway, you can still make your own little dialog box and put something like this[^] on it (there are quite a few other articles about hyper link controls).
|
|
|
|
|
Hi All,
Is there a way by which I could reset the registry to its original state. All the writes to registry should not be flushed to the disk.
Thank you,
AJ
|
|
|
|
|
Using regedit tool, you can eport the registry and then restore it.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
And why is that you say it to CPallini? He's not the one in need of it.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I guess maybe its helpful for him.
|
|
|
|
|
Did you have any backup of registry? or did you use of applications for get bakcup of registry?
|
|
|
|
|
Hi all,
I'm busy trying to create a screensaver in VS2008 (using C++). The screensaver works fine in Vista, but when in XP it gives me an error message of "The procedure entry point ChangeWindowMessageFilter could not be located in the dynamic link library USER32.dll".
According to Bradwich[^], "To allow your program to run on both XP and Vista, you need to retrieve the pointer to the ChangeWindowMessageFilter function dynamically instead of importing it at compile time". I have absolutely no clue how to do this, as I'm still new to C++. Does anyone know how to do this?
Thank you.
PS: I'm using the "framework" from How to Scr[^]
|
|
|
|
|
I think you need to use LoadLibrary to load "user32.dll" and user GetProcAddress to get the function ChangeWindowMessageFilter.
|
|
|
|
|
Thanks for the response
I got as far as:
HMODULE library = LoadLibrary("User32.dll");
FARPROC method = GetProcAddress(library, "ChangeWindowMessageFilter");
FreeLibrary(library);
I don't know how to actually tell the program to use the retrieved method/function. Could someone show me how to that please?
Thank you.
|
|
|
|
|
"method" is a function pointer. You should cast it to a function pointer type that is the same as ChangeWindowMessageFilter.
Then, instead of calling ChangeWindowMessageFilter(...) , call method(...) .
|
|
|
|
|
Hi! I realise that this is an old topic. Sorry, I don't quite understand this. In my screensaver I never use ChangeWindowMessageFilter... but I still get the error. Can someone explain why this happens?
Also, can someone confirm that the previous suggestion works? How exactly do I do the casting and where should this call be made?
Thanks in advance.
|
|
|
|
|
Hi,
The scenario :
A process that generate threads (each thread calls a set of functions that uses a exception throwing as an return value ).
The Dilemma:
a disuse of critical section on those function (that uses a exception throwing as an return value) will cause
unstable windows behavior (win Xp) ?
|
|
|
|
|
ta_isr wrote: will cause
unstable windows behavior (win Xp) ?
Why?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
It's a bit difficult to understand your problem
Is the problem related to the fact that the critical section won't be release because you throw an exception ? If that's the problem, there's a little trick you can implement: wrap the critical section into a class, enter the critical section in your class ctor and leave the critical section in your class destructor.
Now, when you want to use this, just declare an instance of the class (it will call the constructor and enter the CS). When the function is exited, the class goes out of scope and the destructor is called (leaving the CS). Thus, if your function throw an exception, you are sure that the CS is left.
|
|
|
|
|
To clarify the problem:
number of threads that uses the same function (that uses a exception throwing as an return value - can't be changed)
can cause a problem ?
can a thrown exception in thread 1 can be catch in thread 2 ?
|
|
|
|
|
No. Exceptions do not cross threads. But what does it have to do with critical sections ?
|
|
|
|
|
"Exceptions do not cross threads" Thats the answer i want to hear.
Thanks.
|
|
|
|
|
Hi All,
I am using RegFlushKey() API in my application. We have to pass a registry key to the API. The API flushes the entire hive to which the key belongs. Is there any way I can flush only the contents of the key I pass and not the entire hive?
Thank you,
AJ
|
|
|
|