|
Hello everybody,
I want to have a custom title bar with
my own shape.
Please help me,
I want to create it myself not by a class
Best wishes
Thanks
|
|
|
|
|
Hi
I try to Create a File. The LpFileName i will receive from a token. But i get and error when i do this, Why? Error : error C2065: 'Lfilnavn1' : undeclared identifier
Here is some of the code:
HANDLE hFile1;
char seps[] = ",";
char *token;
int ch = ',';
char* filnavn1;
token = strtok((char *)lpCmdLine, seps );
filnavn1 = token;
while( token != NULL )
{
token = strtok( NULL, seps );
// Get all token and assign to strings
}
hFile1 = CreateFile (TEXT(filnavn1), // Open .txt
GENERIC_READ, // Open for reading
0, // Do not share
NULL, // No security
OPEN_EXISTING, // Existing file only
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No template file
|
|
|
|
|
Hi,
just declare your Lfilnavn1 or remove 'L' from filnavn1 in the line where you get this error!
Then it should work
P.
|
|
|
|
|
You wrote :
just declare your Lfilnavn1 or remove L from filnavn1! in the line where you get this error!
I get this error in this line
hFile1 = CreateFile (TEXT(filnavn1), // Open .txt
GENERIC_READ, // Open for reading
0, // Do not share
NULL, // No security
OPEN_EXISTING, // Existing file only
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No template file
As you can see i do not use Lfilenavn1 at all. It is the CreateFile who make the error
So what could be wrong. It works in Visual C++, but not in Emededd C++ that I use.
|
|
|
|
|
The TEXT macro eventually translates to L
What TEXT expects is a quoted string e.g. TEXT("myfile.txt")
What you need to do is convert the char* filnavn1 to a wide char format string when using Embedded C++. Then use this as the first parameter in CreateFile
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi
I have memory leak in my simple consolebased application.
Though I have freed all memory allocated by malloc() or calloc() and deleted it with delete() if allocated with new()....It shows memory leak. I am not able to detect where it is showing memory leak....Is it possible to say at which place it is showing memory leak looking at following dump that I am getting when I use _CrtDumpMemoryLeaks() function.
Detected memory leaks!
Dumping objects ->
{45} normal block at 0x00861E80, 33 bytes long.
Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD
{44} normal block at 0x00860040, 40 bytes long.
Data: < K > 20 10 4B 00 19 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
So where is there exactly memory leak occuring ....? How to know it...?
Thanking in advance...
Mike
|
|
|
|
|
Hi,
If you allocate memory using malloc or calloc function you definitely delete memory using free function. Otherwise, you will get the error message.
See MSDN,
"Important Mixing the new and delete operators with the resizable memory-allocation functions on the same memory block will result in corrupted memory in the Debug version of MFC. You should not use realloc on a memory block allocated with new. Likewise, you should not allocate a memory block with the new operator and delete it with free, or use the delete operator on a block of memory allocated with malloc."
|
|
|
|
|
Did you use delete [] when deleting arrays?
Have your closed all the handles and objects you have opened? These two have caused big problems for us, often it isn't documented that something will allocate memory when you use it. Sometimes the process for freeing that memory isn't clear.
|
|
|
|
|
We have a CAD product which actually drives a HP designjet 430 36inches printer.We will draw some objects and we will create HPG files and will give that to HP designjet 430 printer.But plotout is coming upto 52 inches. An object which is more than 52 inches length it is not drawing completely. Could any one of you tell me what could be the reason for this. Please help me, because it is very urgent.
regards,
Pothirajan C
|
|
|
|
|
Hai Frens
I have two static group box in a dialog. . .
I need to paint each using different color.
Can any one guide me to do that. . .
Thanx
bye
|
|
|
|
|
|
|
I just tried to add some text into the MyProg.Cnt file using the HTML/XML Editor with Encoding editor.
Nothing is displayed when I call up (from the Help memu option other than the following text:-
<<YourApp>> Help Index<br />
<br />
<br />
<< Write a topic here that discusses your application's main dialog.>>
Are they an example project that show the format you should use.
I was told by someone to use a Freeware program Cheetah.
But as its the first time I have tried to use help, I thought that Visual Studio .Net 2002 would have all I needed, just need to know how to use it.
Any articles/wed sites out there, please as not used HTML or XML, but I think could use it with a little effort.
|
|
|
|
|
Hi
I have to write a program in VC++. I want to make a soft keyboard containg some of the actual/physical keys on the keyboard. Now by using mouse if I press on the soft keyboard keys, the same action should occur that occurs when presssed on the physical keys on the keyboard.
I did not work on this type of application till now. Can anyone please help me or give me some directions.
Thanks
Madhavi
|
|
|
|
|
|
i want to write a program by C++ , that it will hide a file so that noone can see this file in the directory. What techonology of this i need to learn to do it by myself?
Thanks
Ask More - Learn More
JohnJone
|
|
|
|
|
HANDLE hFile;
TCHAR fileName = TEXT("C:\\myfile.txt");
hFile = CreateFile(
fileName,
GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
CREATE_NEW,
<code>FILE_ATTRIBUTE_HIDDEN</code>,
NULL);
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
i know what you means. But i want to know other tech. Because if we set the file's attribute is "hide", user can easily unhide if they choose folder option/and choose unhide in windows.
I mean that i will hide all time even user set view unhide file. And just my program can set unhide attribute to the file only.
Ask More - Learn More
JohnJone
|
|
|
|
|
Ah, well, then the answer is simple. It's just not possible
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Oh, i see some application can do that. But i dont know how they do that, what technology they use.
|
|
|
|
|
Really?, on Win32?
Got any links or names?
It sounds interesting, allthough the use of it goes beyond my imagination.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
By the way, how did you notice that the files were hidden
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
john_tran wrote:
What techonology of this i need to learn to do it by myself?
How about SetFileAttributes() ?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi
I wan't to run my exe program and pass some arguments with the exe file. example:
MyProgram.exe "nr1,nr2,nr3,nr4,nr5"
This is some of the code:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char *token;
char seps[] = ",";
token = strtok( lpCmdLine, seps );
This works ok in Visual C++, but i would like to do this in Emededd C++. There i get an error: error C2664: 'strtok' : cannot convert parameter 1 from 'unsigned short *' to 'char *'
How can I do this right?
Thanks!
|
|
|
|
|
try casting your lpCmdLine var to char*
strtok( (char*)lpCmdLine, seps );
It seems strange, cuz LPSTR is an ANSI string...
Hope this helps you,
Davy
|
|
|
|