|
sorry, mistake
it is
typedef CArray<float, float=""> INT_PRICE2;
and
INT_PRICEE2 m_arrPrice2;
Regards.
|
|
|
|
|
I dont know why it is not showing correcct text
it is
typedef CArray angularbracketopen float, float angularbracketclose INT_PRICE2;
I think it not showing becuase of angular brackets
Regards.
|
|
|
|
|
zahid_ash wrote: I dont know why it is not showing correcct text
Use the HTML markers < or >, or simply use the buttons on the bottom of the edit box to print < or > or check the box "Ignore HTML tags in this message (good for code snippets)".
so this is
typedef CArray < float, float > INT_PRICE2;
A CArray is a template element, not for two dimensional arrays.
So what you probably need is:
float INT_PRICE2[100][100];
or
float **INT_PRICE2;
~RaGE();
-- modified at 13:17 Thursday 9th February, 2006
|
|
|
|
|
Yes size is unknown.
So how I will set , get the values in it.
in float **INT_PRICE2;
thanks
Regards.
|
|
|
|
|
zahid_ash wrote: Yes size is unknown
Do you by chance get to know the size of the table at run time ? Then you could initialize the table using the new operator.
If the table keeps growing, you can either:
1. use malloc realloc to adapt the array size at runtime. (Not so good practice)
2. use STLs (a vector of vectors should do the trick).
~RaGE();
|
|
|
|
|
If you really need to use CArray , you could try something like:
typedef CArray<int, int> CIntArray;
typedef CArray<CIntArray*, CIntArray*> C2DIntArray;
C2DIntArray Int2D;
CIntArray *p = new CIntArray;
p->Add(2);
p->Add(8);
p->Add(7);
Int2D.Add(p);
p = new CIntArray;
p->Add(7);
p->Add(0);
p->Add(9);
Int2D.Add(p); This creates a 2x3 array.
----+---+----<br />
| 2 | 8 | 7 |<br />
----+---+----<br />
| 7 | 0 | 9 |<br />
----+---+----
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
What is the purpose of
typedef CArray CIntArray;
What is the difference with:
CArray C2DIntArray;
CArray *pIntArray;
C2DIntArray.Add(pIntArray);
~RaGE();
|
|
|
|
|
zahid_ash wrote: and using its object like
INT_PRICE2 m_arrPrice2;
What about STL::Vector
typedef vector<int> vecint;
typedef vector<vecint> INT_PRICE2;
so you don't have to worry about memory allocation and deallocation, as vector itself do for you!
"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
|
|
|
|
|
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
|
|
|
|
|