|
i want to define a type like this:
<br />
struct PolyLine<br />
{<br />
double box[4];<br />
int nParts;<br />
int nPoints;<br />
int parts[nParts];<br />
Point points[nPoints];<br />
}<br />
but this obviously doesnt work because the array lengths at the end are variables. can anyone suggest a way around this?
|
|
|
|
|
Either allocate the arrays and store the pointers in the structs (but you have to also remember to deallocate the arrays) or use std::vector.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
the thing is, i want to read in a .shp file which has a number of records all structured in that way. so if i could read them into a buffer which is an array of the structs defined before, then the whole file could be read with one call to CFile's Read member. if the array parts of the struct were just pointers, would this still work?
thanks for your help.
|
|
|
|
|
Hi!
I have dialog based application with one modal dialog. The modal dialog should take some data from dialog based application and display it on the screen in the Edit Box. How to do it?
Thanks!
|
|
|
|
|
It sounds like there are two programs involved here. Is that correct? If so, you'll need to use some form of IPC such as DDE, clipboard, RPC, or the WM_COPYDATA message.
Johnny Peszek wrote:
...and display it on the screen in the Edit Box.
Use CWnd::SetWindowText() , or send the edit control a WM_SETTEXT message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
no, I think he want to have the parent's dialog application data display in a modal dialog of that dialog application
anyway, You can either passer the data in the modal dialog constructor ( override the current constructor ) or pass the parent pointer to the modal dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
As a matter of fact there is only one program (dialog based) and it processes data. And there is also a modal dialog as an inserted dialog resource.
Regards.
|
|
|
|
|
That's simple enough then. Change the constructor of the second dialog to also accept a pointer to the first dialog (the parent). Then the second dialog will have access to properties/methods of the first dialog. Something like:
class CDialog2 : public CDialog
{
public:
CDialog2( CDialog1 *pDlg, CWnd *pParent = NULL);
private:
CDialog1 *m_pDlg;
}
CDialog2::CDialog2( CDialog1 *pDlg, CWnd *pParent )
: CDialog(CDialog2::IDD, pParent)
{
m_pDlg = pDlg;
}
...
CDialog2 dlg(this);
dlg.DoModal();
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
It looks fine. I have done everything as you wrote but there is 1 error:
“error C2512: 'CDialog2' : no appropriate default constructor available”.
The error occurs in the method of the CDialog1 in line with CDialog2 dlg;
What should I do?
Regards.
|
|
|
|
|
I messed up.
Johnny Peszek wrote:
What should I do?
Recheck my post again. Sorry about that.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Ok I will do that.
Thanks.
|
|
|
|
|
HI,
How can i Detect that Appearence setting of Desktop is changed.
i mean to say that ,, RightClick->Properties->settings and chages the Pixels appearnce settings of Desktop is changed by user,.
how can i detect by my application ,, so i chage my coordinats too.
thanx
Regards.
|
|
|
|
|
Provide a handler for the WM_SETTINGCHANGE message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi..
I have 2 VC++ Projects..Each project builds a Dll..I have a separate .exe application which will be run and this will access these 2 dll's.. Right now i can debug only one project at a time through VC++..
I want to know if there is any way by whcih I can debug the 2 projects simultaneously..
Thanks
Sudhakar
|
|
|
|
|
HI,
MSDN states for CM_CYVIRTUALSCREEN n CM_CXVIRTUALSCREEN
Windows 98, Windows 2000: Width and height, in pixels, of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. The SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN metrics are the coordinates of the top-left corner of the virtual screen.
it is for Window 98 and 2000
wt for XP,
On windows XP its not working
and
SM_CYFULLSCREEN and SM_CXFULLSCREEN
i used but not draw the fuull screen ,
from buttom there is a space empty
thanx
Regards.
|
|
|
|
|
You should not have a problem on WinXP. I have written code that uses those parameters to GetSystemMetrics() and they return the appropriate x and y for the virtual screen when running on XP.
Can you elaborate on what you mean by not working?
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 Williams (Little Britain)
|
|
|
|
|
hello!
how should i create a 2D line chart using MSChartControl in VC++.I have 2 arrays,one for x-axis and one for y-axis.How should i provide data from these two arrays.
How can i get scale on y-axis(like 1 to 100 instead of R1,R2...)
pls. help me urgently
thanx
sandhyadec26
|
|
|
|
|
Hi..
I'm sending http request in which i'm passing userID/password, then it got struck on HttpEndRequest() in case of windows XP..even on fresh Windows 98 PC.
What do you think it's reason..Is it any reason of security in WinInet or some OS file missing.
In My PC with Windows 98 it's working fine. but as I transfer it stop working,
I've checked Dependency with "Depends" & provided all files, but system Hang (Freeze) when execute function HttpEndRequest().
Plz Suggest any Solution..
Thanks..
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
HI,
How can i Get DeskTop RECT .....
as i do to get RECT of dialogs using GetWindowRect();
actualy i want to draw mine application Window equals to the desktop coordiantes excluding TaskBar area.
any sample. or help ..
thanx
Regards.
|
|
|
|
|
Try using GetSystemMetrics(SM_CXFULLSCREEN)
Regards,
Mahadevan.
|
|
|
|
|
You missed SM_CYFULLSCREEN in order to get the y.
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 Williams (Little Britain)
|
|
|
|
|
if i will try like this then
is it right way
CWnd * wnd = GetDesktopWindow();
RECT rect;
wnd->GetWindowRect(&rect);
MoveWindow(rect.left,rect.top ,rect.right ,rect.bottom -35 , TRUE);
RECT rec;
this->GetWindowRect (&rec);
GetDlgItem(IDC_BUTTON1)->MoveWindow(rec.left,rec.top+70, rec.right ,rec.bottom );
is it right
tell me how i use GetSystemMetrics(SM_CXFULLSCREEN)
thanx
Regards.
|
|
|
|
|
Additionally to what has already been stated.
If you have multiple monitors (or want multiple monitor support) us
SM_CXVIRTUALSCREEN to get the x
SM_CYVIRTUALSCREEN to get the y
As the parameter to GetSystemMetrics
NOTE: the rect will be (0, 0, x, y)
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 Williams (Little Britain)
|
|
|
|
|
Dear all,
I try to save a GDI+ Bitmap in monochome GIF in as following code but failed. Any one can help?
*********
Bitmap* bit= Bitmap::FromFile(L,"Test.bmp");
unsigned long nColorDepth;
nColorDepth=1;
EncoderParameter encParam;
encParam.Guid=EncoderColorDepth;
encParam.Type = EncoderParameterValueTypeLong;
encParam.NumberOfValues = 1;
encParam.Value=&nColorDepth;
EncoderParameters encoderParameters;
encoderParameters.Count = 1;
encoderParameters.Parameter[0]=encParam;
CLSID GIFCodecClsid;
GetCodecClsid(L"image/gif", &GIFCodecClsid);
bit->Save(A2W(strGifPath),&GIFCodecClsid,&encoderParameters);
*********
Kindly help me to solve my problem.
Thanks & Best regards
Le Dac Liem
Vietnam
|
|
|
|
|
Hai frens.
Plz Any one tell me how many kinds of grids r there ?
What r there functionalities ?
How specific we should use those grids ?
Thanx
|
|
|
|