|
LPSTR is a char*
typedef char* PSTR, *LPSTR;
|
|
|
|
|
|
#include "stdafx.h"
#include <iostream>
#include "afx.h"
using namespace::std;
void getPath(LPSTR lpszPath, int max)
{
char pbuf[512];
LPCTSTR lpszFileName = _T("1.txt");
CFile mFile(lpszFileName, CFile::modeRead | CFile::shareCompat);
if(mFile.GetLength() < 2)
return;
mFile.Read(pbuf, 500);
mFile.Close();
memcpy(lpszPath, pbuf, 500);
}
int _tmain(int argc, _TCHAR* argv[])
{
LPSTR lpstr = new char[2000];
memset(lpstr, 0, 2000);
getPath(lpstr, 2000);
return 0;
}
我爸是李刚
|
|
|
|
|
thx for your detailed example
|
|
|
|
|
|
Hi all,
i dont know can can this happen,after running some time my application is fully black,no control or gui display here.
please tell me what can i do for this.
thanks in advance.
|
|
|
|
|
Please switch ON the monitor again.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
monitor is on and other application are fine visible.
|
|
|
|
|
You maight read my answer this way:
You should elaborate: with the provided info we couldn't even guess what is happening with your application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
With his monitor off, he can't read your advice anyway.
|
|
|
|
|
Luc Pattyn wrote: With his monitor off, he can't read your advice anyway.
The joke was on the line of: "dumb question -> dumb answer".
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you wouldn't say.
|
|
|
|
|
Why not?
THIS IS AN INTERNATIONAL FORUM: PLEASE USE THE ENGLISH LANGUAGE HERE
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if you intend to come up with a dumb answer for every dumb question, you will end up exhausting yourself.
|
|
|
|
|
So please stop posting dumb questions...
BTW: Sir, we're waiting for the bridge linking CP Vanity Lite with the real thing.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Le@rner wrote: please tell me what can i do for this.
Fix your program! Your question is far too vague for anyone to give you a solution. You need to do some investigations for yourself to try and determine what is happening in your code, and what part of it is not working correctly. Then present the information you have found and people will try to help you.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
<BLINDSHOT>Maybe you are leaking GDI handles and run out of them after a while</BLINDSHOT>
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
how can find out and recover that
|
|
|
|
|
You can use a 3rd party software like "Process Explorer", i think that can show the number of GDI handles a process uses, if you see this number showing an increasing amount then you are most likely leaking GDI handles. How you can find where is up to you, i don't know of any particular automatic method for that. If you do any drawing yourself somewhere in your application, that's your best bet.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
If you have the source code for the application, try setting breakpoints to zero in on where the blackout is occurring. When you locate the exact statement that's doing it, it will probably tell you what the problem is.
|
|
|
|
|
When i run application its working fine ,this situation occur after running application for a long time .
so i m unable to find out even with use of breakpoints.
When the black out situation occur i chek the task manager and find out these details
Memory(Private Working Set)-101,640 K
Handles 7,099
Threads 1,298
GDI Objects 145
please help me...
|
|
|
|
|
Hi all,
I am reading some values from command line and i want to replace them with other values.
Command line input ranges are from (50,51,52,........... 480,481,482)
I need to replace with (172,171,.....0,-1,-2,...-260)
Here is my code:
int main(int argn, char **argv)
{
char c;
int h;
double Pos[9];
double pd[6];
double test=51;
printf("\nEnter position (val1, val2,val3,val4,val5,val6,val7,val8,val9):\n");
for(h=0; h<9; h++)
scanf("%lf",&Pos[h]);
if(Pos[7]=="50")
Pos[7]=172
if(Pos[7]=="51")
Pos[7]=171;
if(Pos[7]=="52")
Pos[7]=170;
return 1;
}
Can someone help me how to do.
Thanks
Raj
|
|
|
|
|
I don't understand the details of your requirements, however for sure you must take advantage of the linear relationship between the input and the output range:
newValue = 222 - originalValue;
|
|
|
|
|
Your transformation law is
y = 222 - x
(y = 172 - (x-50))
Cannot you simply apply it to the input data?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Don't use doubles for integer values, it will only cause you problems. As stated by both Luc and Carlo, you have a simple calculation to do on each input value, you can then store or output the new values as required.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|