|
The first thing that comes to mind is that a 32-bit EXE can't load 64-bit DLLs and vice-versa. For example, a 32-bit IE plugin won't load in 64-bit IE. But without any details, we can only give you WAGs.
|
|
|
|
|
Michael Dunn wrote: we can only give you WAGs.
Fair comment, just checking out the general opinion. I thought a 32bit exe would run on a 64bit machine using WOW, and wondered if anyone else has had any trouble - looks like they haven't - its just my customer!
Thanks Anyway,
Ali
|
|
|
|
|
Alison Pentland wrote: I thought a 32bit exe would run on a 64bit machine using WOW
It can, you just can't mix 32 and 64 bit modules in the same process.
|
|
|
|
|
rand() returns an integer in the range [0 - RAND_MAX]. What if I want to generate random integers in a wider range? is there no escape from calling rand() twice and then multiplying the results?
Is there a continuous random number generator in C++ ?
Thanks,
Avi.
|
|
|
|
|
avimitrani wrote: is there no escape from calling rand() twice and then multiplying the results?
That's not really random, nor does it give a wide enough range. Try calling it twice and shifting the first result to take the bits above the second result.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You could generate a random number between 0 and 1, then multiply that by the bigger number you want to use, e.g.
flaot fRand = rand() / (float)RAND_MAX;
int iValue = fRand * 10000000;
|
|
|
|
|
That won't work: some values might have no chances at all to be picked.
|
|
|
|
|
|
avimitrani wrote: What if I want to generate random integers in a wider range?
You'll need to roll your own. Something like this.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Iam new to vc++ programming.. iam writing an application which needs some functionalities of some of the activex dlls that I have. Previously static linking to the lib file is done. But right now i need to load active x dlls at runtime. Iam not getting how to instantiate the libraries and loading it at runtime. My platform is Visual Studo 6.0..Can anyone of you help me regarding this. Any help will be appreciated.....
thanks
Bollapalli
bollapalli
|
|
|
|
|
Make sure your ActiveX DLLs are registered. Are these functions graphical or non-graphical components? If they're graphical, you can easily use the dialog editor to put the controls into place, or you could use CWnd::CreateControl to create the controls.
If they're non-graphical components, there are basically two ways to use them. If your components expose interfaces with a vtable (IUnknown-based interface or dual interface), you can use the #import feature of Visual C++. The MSDN docs describe how they are used, and I'm sure you can dig something out about #import here on Codeproject. If not, Google is your friend.
If your component is dispatch only (no vtable), you don't need to #import the ActiveX DLL (unless you've defined structs or typedefs in the typelibrary). Then you can use the COleDispatchDriver class, which helps you to instantiate the component, as well as call methods and manipulate properties. This project could probably benefit you a lot: http://www.codeproject.com/com/xydispdriver.asp[^], as it simplifies the dispatch stuff a great deal.
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
I have designed the FTP client application using the WinInet classes . In that for storing the file on the FTP server i have used the CFtpConnection: PutFile(), but it is not retuning true and so the local file is not getting stored at the FTP server.The Error it is saying is that dwd =2(i.e ERROR_FILE_NOT_FOUND )Please help me out in this ....
Is there any other to store the file on the FTP server...
Thanks n Regards
Shikha
|
|
|
|
|
Why don't you work out why it's returning false, and fix it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for your immediate reply...
its showing ERROR_FILE_NOT_FOUND when i try to fix it using the GetLastError() but i cannot able to find out the reason..
why it need to find the file on the ftp server it should just get store the specified local file on the server side....
Thanks
Shikha
|
|
|
|
|
Perhaps it can't find the local file ? Or you don't have permission to create the file, so it's not found when it tries to write to it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Shikha Jain wrote: The Error it is saying is that dwd =2(i.e ERROR_FILE_NOT_FOUND )...
Why was the local file not found?
Without seeing the relevant code, a helpful answer is going to be a guess at best.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
HI Shikha!!! Are u passing the correct path of the file to be uploaded in the CFtpConnection::PutFile() function??? i am new to programming but i had developed a FTP client just a couple of months back.. so, i want u to see if you are passing the correct path in the PutFile() function. and like what Sir David Crow said, without having a look at ur code, we may not be able to give u the correct suggestions.. so, just see if u can post the sample of ur code...
i used the following lines of code to upload a file called as 'test.txt' residing on my 'C' drive.the file will be stored as 'ftptest.txt' on the FTP server.
<br />
CInternetSession sess(_T("MyFtpModule"));<br />
CFtpConnection* pConnect = NULL;<br />
<br />
pConnect = sess.GetFtpConnection(_T());<br />
<br />
BOOL bUploaded = pConnect->PutFile("C:\\test.txt","ftptest.txt",FTP_TRANSFER_TYPE_ASCII,1);
I want others to correct if i am wrong..
Regards, vijay Aroli.
|
|
|
|
|
Dear All,
How do i check a char array and a string ?
Use some simple methods ?
|
|
|
|
|
What do you mean by ... " do i check " .... ??
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hello Programmer 3r ...
What you are thinking yourself ?
are you a good programmer ?
If you dont know answers., Leave it and do your work..
This is forums. okey ...
Whoever can get help. If you cant answers., keep calm.
bye...
|
|
|
|
|
|
Okey .. I dnot know much english. I accept that.
I am new to programming.. I dont know these questions are silly questions or not.
Shouldn't i ask questions like this ?
bye ...
|
|
|
|
|
You can ask any question you like regarding Visual C++ / MFC, but like I said If someone doesn't understand the question your asking, make it easier for the person trying to help you by providing sufficient information. And no one said the question you where asking was "silly".
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
If you'd fix your signature such that it did not run into your posts, people wouldn't get confused into thinking you are directing the comment towards them.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I agree with David Crow modify your sig
|
|
|
|