|
One final note: you should use
printf("0x%.2x",(unsigned)buf[k]); since the %x format-specifier expects an int -sized value in the argument list.
Software Zen: delete this;
|
|
|
|
|
unsigned char *buf = NULL;
buf = (unsigned char *) malloc( 12 );
if( buf )
{
*buf=0x01;
*(buf+1)=0x02;
*(buf+2)=0x03;
*(buf+3)=0x04;
*(buf+4)=NULL;
for(int k=0 ; buf[k] != NULL; k++)
{
printf("0x%.2x ",buf[k]);
}
free( buf );
}
I think this will work for u.
|
|
|
|
|
|
Im working in VC++ 2003, my project uses a .lib and a .dll generated in VC++ 2005
I get the following runtime error as soon as I execute the App
LDR: LdrpWalkImportDescriptor() failed to probe c:\Mapi\MAPIEx.dll for its manifest, ntstatus 0xc0150002
Can Anyone help me to solve this?
Thanks in advance
Sebastian
|
|
|
|
|
I had that exact same error yesterday with a resource only DLL. When I went into the project properties and changed the Linker->Manifest File->Generate manifest setting to "No", my error went away.
BUT changing that setting back to "Yes" did not reproduce the error message.
|
|
|
|
|
Yeap I dont know whats that error, finally I made a new project and re compiled it and now all is working right
Thanks for the feedback
|
|
|
|
|
Can anyone please help me to find out a simple way to read a text file line by line in Visual C++ 6. Thanks in advance.
Regards,
Vikram
|
|
|
|
|
|
You can try fgets which is C function
look the sample code snippet
FILE *fp = fopen("c:\\file.txt","r");
char ar[100];
while(fgets(ar,100,fp))
{
print (ar);
}
fclose(fp);
If u can Dream... U can do it
|
|
|
|
|
And if you are using MFC, there's CStdioFile::ReadString() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think this will work CStdioFile::ReadString
|
|
|
|
|
Can you be more specific Its a minimum info
|
|
|
|
|
yeah WhiteSky..I am developing a dialog based MFC application, in which i want to read a text file line by line for parsing and identifying certain charaters such as (), *. % etc. So i wanted to read the text file line by line to count occurance of each keyword at each line. Hope this information is sufficient.
|
|
|
|
|
well you can use of David answer CStdioFile::ReadString or CFile::Read
|
|
|
|
|
thanks very much...but i think CFile::Read reads the specified number of characters at one go. How do we know the size of each line well in advance. Is there any function in CFile that facilitates it?
|
|
|
|
|
vikram.vit wrote: How do we know the size of each line well in advance.
You don't (at least not without a lot of unnecessary code). That's why I suggested CStdioFile::ReadString() and not CFile::Read() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All
In my application "unexpected end of file found" errors is occurd. If anybody know the solution plz send me.
Ragards
Atool
Atool
|
|
|
|
|
See in your project setting --> C/C++ -->Precompile headers -->Create/Use precompiled header option. If its /Yu , include file mentioned in Create/Use PCH Through File option(usually stdafx.h ) as first include file your(in fact it should be first statement ) cpp file.
|
|
|
|
|
M. Atul wrote: In my application "unexpected end of file found" errors is occurd.
When? During compilation, or at run-time?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
This usually occurs in my programs because I forgot to "#include "stdafx.h" in my class's .cpp file
A C++ programming language novice, but striving to learn
|
|
|
|
|
If I make changes to the registry (these changes will effect Win95), how
can I make Win95 update and refresh the registry, and thus make the
changes to windows95?
How can get the string value(sub key like string value, DWORD value, Binary value, etc.) from registry?
For example if my app sets the flag for a registry key, via the registry, how can I make windows95 refresh the registry and make the change?
Im using VC++ 6.0.
Enjoy Life........
|
|
|
|
|
what you mean by refreshing registry ? and what exactly are u setting ?
If u can Dream... U can do it
|
|
|
|
|
Poonamol wrote: If I make changes to the registry (these changes will effect Win95), how
can I make Win95 update and refresh the registry...
By using the registry API (e.g., RegOpenKeyEx() , RegCreateKeyEx() , RegQueryValueEx() ).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello all,
I have one Edit Control IDC_PATH , and some path in (LPARAM)szDir variable.
Now I want to set the value of szDir in the IDC_PATH edit box , how to do this ?? Please can anyone tell me hw to do this .
<br />
SendDlgItemMessage(hwnd,IDC_PATH,(LPARAM)szDir,0,0);
I tried with this code its not working. What will be the error ?
Edit/Delete Message
And also I want to know how to disable and enable edit box ???
Thanking you,
Suresh HC.
|
|
|
|