|
Why are you expecting to see random output? I don't see any randomness-generating functions in your code. Try adding a random delay somewhere and see if that changes the output.
|
|
|
|
|
I'm using Intel's C++ compiler, version 6, as a plug-in compiler in Visual Studio 6, with the latest MS Platform SDK. When I use the Qwp_ipo (multi-file interprocedural optimizations) compiler switch, I get the following error at link time:
IPO: performing multi-file optimizations
Error unresolved : _main
Referenced in libc.lib(crt0.obj)
I do NOT have _ATL_MIN_CRT defined. Additionally, this problem never occurred with the MS compiler or version 5 of Intel's compiler.
If I link dynamically with /MD instead of with /ML, it builds fine, but that requires the end user to have one Intel's math library dll which I can't redistribute under the evaluation license I have.
I don't even know how to start debugging this...
|
|
|
|
|
Anonymous wrote:
If I link dynamically with /MD instead of with /ML, it builds fine, but that requires the end user to have one Intel's math library dll which I can't redistribute under the evaluation license I have.
But you are allowed to distribute a compiled binary??? Methinksnot.
Besides, this is the wrong place for your question. Please contact Intel or try some Intel newsgroups/forums.
|
|
|
|
|
>> But you are allowed to distribute a compiled binary??? Methinksnot.
There is no statement to that effect in the license agreement. Anyway, thanks for the reply.
|
|
|
|
|
When it comes to the "DeviceIoControl (hCD, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &dgCDROM, sizeof(dgCDROM), &dwNotUsed, NULL)" function, the GetLastError returns 1, which is incorrect function, what is that?
code:
HANDLE hCD, hFile;
DWORD dwNotUsed;
hFile = CreateFile ("sector.dat",
GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
hCD = CreateFile ("\\\\.\\D:", GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
if (hCD != INVALID_HANDLE_VALUE)
{
DISK_GEOMETRY dgCDROM;
PREVENT_MEDIA_REMOVAL pmrLockCDROM;
pmrLockCDROM.PreventMediaRemoval = TRUE;
DeviceIoControl (hCD, IOCTL_DISK_MEDIA_REMOVAL,
&pmrLockCDROM, sizeof(pmrLockCDROM), NULL,
0, &dwNotUsed, NULL);
if (DeviceIoControl (hCD, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, &dgCDROM, sizeof(dgCDROM), &dwNotUsed, NULL))
{
LPBYTE lpSector;
DWORD dwSize = 2 * dgCDROM.BytesPerSector;
lpSector = (LPBYTE)VirtualAlloc (NULL, dwSize, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
SetFilePointer (hCD, dgCDROM.BytesPerSector * 16,
NULL, FILE_BEGIN);
if (ReadFile (hCD, lpSector, dwSize, &dwNotUsed, NULL))
WriteFile (hFile, lpSector, dwSize, &dwNotUsed, NULL);
VirtualFree (lpSector, 0, MEM_RELEASE);
}
pmrLockCDROM.PreventMediaRemoval = FALSE;
DeviceIoControl (hCD, IOCTL_DISK_MEDIA_REMOVAL,
&pmrLockCDROM, sizeof(pmrLockCDROM), NULL,
0, &dwNotUsed, NULL);
CloseHandle (hCD);
CloseHandle (hFile);
}
r, true);
// Unlock the disc in the CD-ROM drive.
pmrLockCDROM.PreventMediaRemoval = FALSE;
DeviceIoControl (hCD, IOCTL_DISK_MEDIA_REMOVAL,
&pmrLockCDROM, sizeof(pmrLockCDROM), NULL,
0, &dwNotUsed, NULL);
CloseHandle (hCD);
CloseHandle (hFile);
}
|
|
|
|
|
Isn't it that you can only use IOCTL_DISK_GET_DRIVE_GEOMETRY on a physical device? You only have a handle to the mounted filesystem.
|
|
|
|
|
ok, this is my code:
char *s = (char *)malloc(1024);
DWORD dwBytesRead;
HANDLE hFile;
hFile = CreateFile("\\\\.\\D:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
ReadFile(hFile, s, 1024, &dwBytesRead, NULL);
CloseHandle(hFile);
free(s);
D is my CD drive, but when i do this, the ReadFile function returns 1 indicating the operation went succesful. bu the dwBytesRead is 0 and the buffer hasn't been filled. however if i change the "\\\\.\\D:" to ("\\\\.\\C:", then it works fine, anyone know what's wrong?
thanks in advance
|
|
|
|
|
I don't have the answer to your question but I don't think you want FILE_SHARE_WRITE on a read-only device.
|
|
|
|
|
I know, but it can't hurt, can it?
|
|
|
|
|
sonork: 100:18407
You yard yellow years yieldingly; you yanked your yearning yoke.
-Jeremy Falcon
|
|
|
|
|
Here's some code to help you out.
void CCDReadDlg::ReadCD()
{
DWORD dwSize = 2048;
DWORD dwBytesRead;
LPBYTE lpBuffer;
HANDLE hFile;
hFile = CreateFile("\\\\.\\F:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
lpBuffer =(unsigned char*) VirtualAlloc (NULL, dwSize,
MEM_COMMIT|MEM_RESERVE,
PAGE_READWRITE);
//In CDFS(i.e.ISO9660 format) sector size is 2048.
//the first 16 sectors are always filled with 0's
//To get something meaningful first skip to 16th sector and then read
//course the propah way is to first use DeviceIoControl calls
//to lock the media and finally unlock it after reading... .
SetFilePointer (hFile, dwSize*16,
NULL, FILE_BEGIN);
if (ReadFile (hFile, lpBuffer, dwSize, &dwBytesRead, NULL))
{
//you buffer should have a volume descriptor
//to begin with
//do something
}
VirtualFree (lpBuffer, 0, MEM_RELEASE);
}
CloseHandle(hFile);
}
sonork: 100:18407
You yard yellow years yieldingly; you yanked your yearning yoke.
-Jeremy Falcon
|
|
|
|
|
dwBytesRead is 0 and lpBuffer is empty. But the ReadFile function returns 1 so there shouldn't be anything wrong... strange
|
|
|
|
|
dwBytesRead is 2048 for me(with media present in CDROM ofcourse) i.e. 1 sector(just what I want) and lpBuffer contains the CDROM volume description as expected.
You yard yellow years yieldingly; you yanked your yearning yoke.-Jeremy Falcon-CPite.
Amit Dey
sonork: 100:18407
msn: visualcdev
|
|
|
|
|
Is your CDROM drive setup correctly? Do you have any other cdfs drivers like Adaptec DirectCD on your system? course, you are trying this code on Win2K/NT...right?
hmmm....
You yard yellow years yieldingly; you yanked your yearning yoke.-Jeremy Falcon-CPite.
Amit Dey
sonork: 100:18407
msn: visualcdev
|
|
|
|
|
HI
i want to have a toolbar on desktop, but CreateToolbarEx()
needs a window handle as a parent. I have passed the desktop handle by calling GetDesktopWindow but it doesn't work. Is there any solution to the problem.
|
|
|
|
|
You'd want to use an appbar. Please lookup codeproject for an article and code on appbars.
sonork: 100:18407
You yard yellow years yieldingly; you yanked your yearning yoke.
-Jeremy Falcon
|
|
|
|
|
I made a Visual C++ application that uses ADO to query a database, and to update the changes.
I send some simple SQL statement to the database (an Access DB until now), like SELECT, UPDATE, etc.
Now I would like to make this through the internet.
I mean I run my program on my computer and it query the database that instead is on another computer, and it connects to it via tha Internet.
Where I can find a guide on how to do it?
Thankyou.
P.S.
I also think that I will need to use SQL Server or Oracle to store my database remotely, ad than use this server. Are there any service that offers this kind of hosting for free, so that I can start experimenting, without the hassle of installing my own SQL Server or ORACLE ?
Thank you very much.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
You can do this any number of ways.
Here is how we currently do it at work:
Create an XML file on the client describing the data.
Send the XML to an ASP page which then passes it on to a COM object.
The COM object parses the entire XML and adds the data to the db.
You could also use an ISAPI DLL to parse the data.
(BTW, you need to have IIS running on the computer you are sending to.)
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
If i have a function that uses a for loop that does very much and the action could take up to 5 minutes. How do i, if i have a cancel button on the form, make that cancel button usable? Cause i can't use it while the for loop is running. I saw something in the faq about multithreading but i don't know how to use it.
Thanks in advance.
|
|
|
|
|
I think this will work:
void Yield()
{
MSG msg;
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
for ...
{
Yield();
}
Jason Henderson quasi-homepage articles "Like it or not, I'm right!"
|
|
|
|
|
Thankyou, works perfectly.
|
|
|
|
|
Hi all,
I want to make a file system driver to access BeOS partitions from windows 2000. I am having a hard time learning how to get access to the partition info and how to mount a drive so that I can then access the foreign file system.
I guess after I am successfull in mounting a drive (including all the code to read and write) I will need to make it a shell extension so that it shows up transparently in Explorer? Is that right?
Any pointers to tutorials, source code, etc. would be greatly appreciated.
Cheers,
Clint
|
|
|
|
|
I think you will find open source filesystem drivers for NTFS,ext2(Linux) at sourceforge.net very illuminating.There are a couple of Beos ports to NTFS drivers too(I think).
sonork: 100:18407
You yard yellow years yieldingly; you yanked your yearning yoke.
-Jeremy Falcon
|
|
|
|
|
Then you're in for a treat. Not!
MS has the FSD SDK for $5k (or is it perhaps $10k+ nowadays?) with no support, sparse documentation and no promises they won't change everything behind your back even from service-pack to service-pack, making this one of the "great developer experiences" that MS loves to force down our throats with a rough 2-by-4 without any K-Y.
Good luck, I really think you need it.
I guess after I am successfull in mounting a drive (including all the code to read and write) I will need to make it a shell extension so that it shows up transparently in Explorer? Is that right?
No. Once you have the filesystem mounted it's just like any other filesystem (except that you can't use half of the features in BFS on this DOS-emulation platform). You perhaps could get access to the attributes using the NT-only syntax for alternate file streams "filename:stream_name", but since you'd be the only one using it (since it's incompatible with everything except NTFS almost no-one ever uses it) you'd (obviously) have to write your own programs to access that too.
The only place I can point you to is http://ntfsd.org
++luck;
|
|
|
|
|
Thanks for you information. I am too poor to afford anything so I guess the FSD SDK is out of the question.
One thing I would like clarification on is about the dos-emulation layer you mentioned. I am aware that there is an emulation layer but are you saying I could write a driver for dos and use it to access another filesystem from within win2k?
Thanks again,
Clint
|
|
|
|
|