|
Hi,
I wanted to know how do i get a checkbox in the 2nd or 3rd subitem of a Listview using Win32 APIs and without using Customdraw. please help...
thanks in advance....
regards
Neeraj
-- modified at 10:56 Thursday 9th February, 2006
|
|
|
|
|
After you all sorting out my problem with adding strings to a listbox, I now have a few more questions about them:
Is ther a limit to the amount of strings that can be added to a ListBox? My application will run indefinitly, so could end up having a huge amount of text entered into it - will this be a problem?
If it is, is there an easy way to limit the amount of strings, so that if you enter more into the ListBox, the first ones (oldest) will fall off the List?
Thansk for all your help
Mike
|
|
|
|
|
I think the limit is either 16000 or 32000 strings. I seem to remember seeing a virtual list box article on CP somewhere.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John
I just did an experiment with my app, and it hung once I had written 32736 lines into it!
In a normal day, I shouldnt be adding more than 100 lines of text a day to the ListBox, so that would mean i could run the app for approx 1 year before this would become an issue. Still, it would be nice to block the problem from happening...
Thanks again
Mike
|
|
|
|
|
as john suggested, use a virtual listbox ...
search this site on how to do it; it's not at all complicated ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Do you really want to wade through several thousand items in the listbox? Why not create a circular list (i.e., older items get replaced by newer items) that only holds a small amount of items? The listbox could then show the contents of this list.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Dear everyone,
I am trying to capture screen shots of my application at different intervals. The program works fine when interval is 0.3 second. whenever I increase the interval to more than 0.3 (eg 1 second). I get totally black screen shots.
Please Can someone explain whats going wrong ? Thank you
here is the main code of my program:
bool CWebPageAnalyserDlg::iterateAndCapture(void)
{
int status = 1;
double interval = 0.3, result = 0;
clock_t clo = clock();
for(int i =0; i< 2; i++){
clo = clo + (clock_t)(interval * CLK_TCK);
result = (double) clo;
while (clock() < clo){
if (status==1) {
captureScreen(1);
status = 2;
} else {
captureScreen(2);
status = 1;
}
}
}
return false;
}
IDirect3DDevice8* g_pd3dDevice = NULL;
IDirect3DSurface8* surface = NULL;
HWND hwnd;
FILE* capture=fopen("Capture.txt","w");
void CWebPageAnalyserDlg::captureScreen(int status)
{
HRESULT hr;
CClientDC dc(this);
CWnd* cwnd = dc.GetWindow();
hwnd = cwnd->GetSafeHwnd();
IDirect3D8* g_pD3D = Direct3DCreate8(D3D_SDK_VERSION);
D3DDISPLAYMODE mode;
hr = g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &mode);
UINT ScreenWidth = mode.Width;
UINT ScreenHeight= mode.Height;
D3DPRESENT_PARAMETERS present;
ZeroMemory(&present, sizeof(present));
present.SwapEffect = D3DSWAPEFFECT_COPY;
present.Windowed = TRUE;
present.BackBufferFormat = mode.Format;
hr = g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present, &g_pd3dDevice);
g_pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
if(FAILED(hr)) fprintf(capture,"\nSomething went wrong");
hr = g_pd3dDevice->CreateImageSurface(ScreenWidth,ScreenHeight, D3DFMT_A8R8G8B8,&surface);
if(FAILED(hr)) fprintf(capture,"\nSomething went wrong");
char* fileNameOne = (char*)"FirstShot.bmp";
char* fileNameTwo = (char*)"SecondShot.bmp";
g_pd3dDevice->GetFrontBuffer(surface);
if(status == 1)D3DXSaveSurfaceToFile(fileNameOne, D3DXIFF_BMP, surface, NULL, NULL);
if(status == 2)D3DXSaveSurfaceToFile(fileNameTwo, D3DXIFF_BMP, surface, NULL, NULL);
surface->Release();
}
llp00na
|
|
|
|
|
Hi,
I created one application in VC++/MFC in WINDOWS 2000,
If i try to execute the same application in WINDOWS XP,
it not get started and doesn't through any error..
Reply early
Thanx
M.Maharaja Pandian
send reply
|
|
|
|
|
elaborate ur problem.Are u getting any error?mention it
never say die
|
|
|
|
|
|
thnx for ur reply
i try with some other win Xp system it get started ,but after sometime it through some memory error like
sample.exe - Application Error
The instruction at "0x6c3b7f98" referenced memory at "0x00000048". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
send reply
|
|
|
|
|
Try to use the debugger (F5) to see where the code crashes.
|
|
|
|
|
thnx for ur reply
i try with some other win Xp system it get started ,but after sometime it through some memory error like
sample.exe - Application Error
The instruction at "0x6c3b7f98" referenced memory at "0x00000048". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK Cancel
send reply
send reply
|
|
|
|
|
maharaja pandian wrote: The instruction at "0x6c3b7f98" referenced memory at "0x00000048". The memory could not be "read".
Click on OK to terminate the program
Click on CANCEL to debug the program
Probably some application which support Window 2000, IS not supporting XP.. you have manually debug the application to find which api or control is not working with window XP
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have a function in a DLL which tries to display a dialog box.
CAppDlg Dlg;
x = Dlg.DoModal();
x returns -1. GetLastError() returns 1812 which I believe transaltes to "The specified image file did not contain a resource section". I have no idea what this error means.
I've seen a few posts regarding this error in the forum but no definitive answer. Can anyone help me out with this ?
Thanks
Ethann
|
|
|
|
|
|
It is a "more severe" version of ERROR_RESOURCE_NAME_NOT_FOUND . Instead of not being to find the (dialog) resource you are looking for, the OS could not find any resources in the executable(s), period.
If you are trying to launch a dialog from a dialog template resource, either the DLL or the executable loading the DLL should have that dialog template available (and with the correct ID).
If it is in the DLL, but not in the EXE, then you may have a problem where the DLL is not added to the resource chain.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I think you need to read through MFC's technical note 58.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
How do i replace the '\' with "\\" in a lpstr?
char* st= "c:\windows\system\test.txt";
i want to replace all \ by \\... so that , the file test.txt can be reached.
??
VuNic
|
|
|
|
|
actually, if you write it like this, the compiler tries to escape the characters '\w' and '\t' .
if you receive the string from an application running, or from another dialogBox for example, then you don't need to replace the \ with \\ because the '\\' representation is only a design/coding time issue...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
ohh... that absolutely true.! no need to convert at all!! its working fine.
VuNic
|
|
|
|
|
Hello,
SDI(Single document interface) comes with a single view as default (AFAIK), but i want to create more than one view of a single document.
How can i do this in SDI?
Thanks,
Bekir
|
|
|
|
|
Look in the Doc/View articles section. There's a couple of articles written that describe exactly how to do that.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: There's a couple of articles written that describe exactly how to do that
Really, John ? I did not find anything that comes down to the basic level, only advanced stuff out there.
~RaGE();
|
|
|
|