'Print.exe': Loaded 'C:\... ...\WriteFile00\Debug\Print.exe', Symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'Print.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
The program '[1316] Print.exe: Native' has exited with code 0 (0x0).
Contents of debug window on another computer
'Print.exe': Loaded 'C:\... ...\WriteFile00\Debug\Print.exe', Symbols loaded.
'Print.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Cannot find or open a required DBG file.
'Print.exe': Loaded 'C:\WINNT\system32\USER32.DLL', Cannot find or open a required DBG file.
'Print.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Cannot find or open a required DBG file.
'Print.exe': Loaded 'C:\WINNT\system32\GDI32.DLL', Cannot find or open a required DBG file.
The program '[624] Print.exe: Native' has exited with code 0 (0x0).
Why the different output?
What does Cannot find or open a required DBG file mean?
S_M_A
July 18th, 2010, 11:39 AM
What does Cannot find or open a required DBG file mean?It just means that those dll's don't have any debug information, i.e. nothing to be worried about.
mmscg
July 18th, 2010, 11:49 AM
OK, Thanks!
I can continue on this path then.
mmscg
July 18th, 2010, 06:23 PM
Moving forward, I have this:
#include <windows.h>
#include <stdio.h>
int WINAPI WinMain(HINSTANCE hInstance , HINSTANCE hPrevInstance ,
PSTR lpCmdLine , int nCmdShow )
{
Because lpEvent->lpData is not NULL terminated.
If you want to read 8 characters from a file into a buffer and later print it, it's best to allocate 9 bytes, read 8 bytes from file and set the 9th byte to \0. That way, fprintf will stop correctly at the \0 and will not print garbage.
mmscg
July 21st, 2010, 12:38 PM
I think I understand what you are saying, and I will try as you suggest.
What I do not understand is the length of my returned string; 8 characters in untitled and 8 «
Is lpEvent->lpData a pointer to a buffer?
If yes, does this buffer have a fixed or limiting size?
Marc G
July 21st, 2010, 01:45 PM
Yes, lpEvent->lpData is some kind of buffer.
When you pass it to fprintf, fprintf will just output characters until it finds a \0 character.
mmscg
July 24th, 2010, 10:47 PM
With regards to the code/output in Post #11, I would like output as so:
lpEvent->nData = 8
lpEvent->lpData = <untitled««««««««>
char 1 = u = hex = 75
char 2 = n = hex = 6E
char 3 = t = hex = 74
char 4 = i = hex = 69
char 5 = t = hex = 74
char 6 = l = hex = 6C
char 7 = e = hex = 65
char 8 = d = hex = 64
This now is not a question of how to use the fprintf function, but rather
how to read each character in turn from the lpEvent->lpData string and convert to hex.
BOOL ReadMidiFile(LPTSTR lpszFileName)
{
HMMIO hmmio;
WORD i;
WORD wTrack;
WORD wFormat;
WORD wTime;
DWORD dwMagic;
DWORD dwDataLen;
LPEVENT *lplpEvent;
case 0x80:
case 0x90:
case 0xA0:
case 0xB0:
case 0xE0:
mmioRead(hmmio, (HPSTR)&lpEvent->data1, sizeof(BYTE));
mmioRead(hmmio, (HPSTR)&lpEvent->data2, sizeof(BYTE));
break;
case 0xC0:
case 0xD0:
mmioRead(hmmio, (HPSTR)&lpEvent->data1, sizeof(BYTE));
lpEvent->data2 = 0;
break;
case 0xF0:
if (lpEvent->state == 0xF0) {
mmioRead(hmmio, (HPSTR)&lpEvent->nData, sizeof(BYTE));
case 0x00: dw = 2; break;
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x07: break;
case 0x20: dw = 1; break;
case 0x21: dw = 1; break;
case 0x2F: dw = 0; break;
case 0x51: dw = 3; break;
case 0x54: dw = 5; break;
case 0x58: dw = 4; break;
case 0x59: dw = 2; break;
case 0x7F: break;