|
|
You should not put files with these extensions under source control.
.ncb
.aps
.clw
The .ncb file contains your Class View information, and if it read-only, you'll get the message you see.
The .aps file is your "apstudio" resources and also need to be read/write.
The .clw file is the class wizard file.
In fact, I recommend that you delete those files on a regular basis - they will all be recreated when needed automatically.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
|
You could add the following to that list:
.pch
.mdp
.obj
.exe
.cpl
.awk
.exp
.lib
.idb
.opt
.pdb
.map
.res
.ilk
.bsc
.sbr
.dll
.tlb
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks again,
However, most of these are in the Release / Debug folders which I had already excluded from ClearCase as I knew their contents were re-created during compilation.
|
|
|
|
|
Hi,
I have two CEdit controls in a dialog.
In Change() event handler of first control, I'm using first control's value and setting another random value of second control and finally calling UpdateData(FALSE);
But the text in first control remains same (old - whatever it was set in InitDialog()) and the caret is repositioned at first character.
Why isn't text if first control changing and caret is being positioned at first character again and again?
Can anyone help me out?
Regards,
Abhijeet
|
|
|
|
|
a_b_pathak wrote: Why isn't text if first control changing
You stated "I'm using first control's value and setting another random value of second control".
Why would that change the first control's text?
Can you post the code for your "Change() event handler"?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
a_b_pathak wrote: ...and finally calling UpdateData(FALSE);
Why are you using UpdateData() for this? Just use a CEdit member variable for each edit control, and call the SetWindowText() method. For example:
void CDlg::OnChangeEdit1( LPNMHDR, LRESULT* )
{
CString strEdit1;
m_edit1.GetWindowText(strEdit1);
m_edit2.SetWindowText("Hello " + strEdit1);
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I found it....
I forgot to call UpdateData(TRUE); at the start of function so the text of first
control wasn't changing! stupid mistake though...
I'm not using Set/GetWindowText because i'm using Control Variable (value).
|
|
|
|
|
a_b_pathak wrote: I'm not using Set/GetWindowText because i'm using Control Variable
Then you can use the CWnd::GetWindowText/CWnd::SetWindowText methods, as DavidCrow stated.
FYI - You don't always need to use UpdateData()...see Avoiding UpdateData[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
Background:
I have two streams, one that writes to a text file called replay.txt, and one that reads from replay.txt. Both events occur while my app is running. So the basic architecture is that while I am simulating something, the app is writing to replay.txt keep track of position of objects and sensors and isDone is false. When the simulation is complete, isDone is true, and the app reads from replay.txt and uses the data in the file to replicate the simulation (like a replay video). dg_replay is the stream that reads from the file. Following the the text file data:
replay.txt
---------
dg_bead
-15
5
5
1
0
dg_grasper
0
0
0
0
Problem: In line marked (A), the values read into x,y,z,d,ts are -15,5,5,1,0 respectively. Then i++ which means that that (i=0) stuff is not going to be processed again. The next process is going to be in the else clause which reads in x,y,z,ss. Now logically, as i would think, the next four numbers should be 0,0,0,0 respectively in those variables. However the data read in to x,y,z,ss is also -15,5,5,1,0!! The same data is read twice..WHY??!
code:
(note #1: i have initialized all variables in the beginning of the file - not shown)
(note #2: this code snippet is part of a function that is called every 1/30th of a second which basically makes this part of a loop)
-----
if (isDone) {
cerr << "eof: " << dg_replay.eof() << "\n";
if (!dg_replay.eof()) {
if (i == 0) { // signals the app to read in the initial states in the file
dg_scenario::dg_video.close();
dg_scenario::video = 1;
if (dg_replay.is_open()) dg_replay.getline(tool_name,256);
(A) dg_replay >> x >> y >> z >> d >> ts;
universe->findObject(tool_name)->CenterObject();
universe->findObject(tool_name)->Translate(x,y,z);
universe->findObject(tool_name)->setDynamicsInt(d);
universe->findObject(tool_name)->being_grabbed = ts;
dg_replay.getline(tool_name,256);
} else {
// process sensor stuff - PROBLEM: reading in the same #s (-15,5,5,) everytime...
(B) dg_replay >> x >> y >> z >> ss;
xyz.x = x; xyz.y = y; xyz.z = z;
left_down = ss; // mouse sensor state - if left_down is 0, then its false and forcep is open etc..
}
i++;
} else {
i = -1;
dg_replay.close();
}
}
--
dg
|
|
|
|
|
Are you reopening the file every time this is called? If so, you may need to keep track of the
file pointer so you can seek past the last read data each time.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
the file is opened for reading in at the very top of the file where i initialize of the variables in th header class. i am assuming that this happens only once... these are the lines:
code:
--------
extern springCore* springApp;<br />
<br />
extern int window_height, window_width;<br />
extern int wf_window_id;<br />
extern void Reshape(int w, int h);<br />
extern SensorArray sensorarray;<br />
extern int current_sensor_index;<br />
<br />
int loop_1, loop_2, loop_3, i = 0;<br />
<br />
int dg_scenario::debug = 0;<br />
int dg_scenario::wf = 1;<br />
int dg_scenario::video = 0;<br />
double len = 5.0;<br />
<br />
extern int left_down, right_down, middle_down;<br />
<br />
ofstream dg_scenario::dg_video("replay.txt", ios::out); <-- for reading INTO the file<br />
ifstream dg_scenario::dg_replay("replay.txt", ios::in); <-- for reading OUT OF the file<br />
char tool_name_1[256];<br />
char tool_name_2[256];<br />
double x,y,z = 0.0;<br />
int d,ts,ss = 0;<br />
Point3D xyz;
--
dg
|
|
|
|
|
OK - i did some playing around and some googling and for some reason if I replace:
dg_replay.getline(tool_name_2,256);
with:
dg_replay >> tool_name_2;
the numbers are read in successfully..
weird..i feel lucky!
--
dg
|
|
|
|
|
Cool
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
I'm sorry for this re-post. I invested much time in my design and need to get it working.
I've got a Wizard Form where i create controls in runtime.
I need to attach the reference/pointer of a String/double variable to a control. This variables exists in another class. so when the Wizard finishes, i iterate through all the controls and each control updates it's own referenced varaible. In .NET i used the Control.Tag property (is of type Object - that was easy). Want to do the same in C++ but the Control->Tag is of int type.
Im missing something. Help me to convert the parameter Value:
<br />
void ExcuteWizard(..., AnsiString &Value)<br />
{<br />
TTextbox ctrl = new ....;<br />
<br />
ctrl->Tag = Value;
<br />
}<br />
void FinnishWizard()<br />
{<br />
for each control{<br />
((&AnsiString)Control->Tag) = Control->Text;
}<br />
}<br />
<br />
Have someone a theory or explanation with regards to pointer and reference conversions? From a Pointer to a Int back to the Pointer. Hope you guys understand what i'm trying to do.
Thanks.
|
|
|
|
|
I need a simple Windows application to detect messages from a USB drive. When the application detects that a USB device has been inserted, I need to launch another application.
I have found an example which works in .NET environments but I can't guarantee that all my users will be working on .NET-supported platforms.
Does anyone know of a simple C++ application containing a basic message loop that I can adapt? I don't care about the UI.
Alternately, is there an easy way to convert .NET code so that it will work on a non-.NET platform?
I'm working in Visual C++ 2005 Express.
Thanks!
|
|
|
|
|
|
I want to cut a bitmap and save the selection I cut what is anomalistic under GDI+.Is there any program that I can refer to?
Thanks.
|
|
|
|
|
Do you mean something like this?
Gdiplus::Bitmap SrcBitmap(...);
...
Gdiplus::Bitmap DstBitmap(CropWidth, CropHeight, SrcBitmap.GetPixelFormat());
Graphics DstGraphics(&DstBitmap);
DstGraphics.DrawImage(&SrcBitmap, 0, 0, CropLeft, CropTop, CropWidth, CropHeight, UnitPixel);
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
I am not so familiar with GDI+,so I don't know that the code your provided can wheather achieve my purpose definitely.What I mean is the region in the bitmap is not necessarily a rect,it is mainly region that I draw with mouse.So it is a irregular region.Could you get it?;P
|
|
|
|
|
Chen-XuNuo wrote: What I mean is the region in the bitmap is not necessarily a rect,it is mainly region that I draw with mouse.
You could create a GraphicsPath object from the mouse points defining the outline and then
use Graphics::SetClip() to set the clipping region to the GraphicsPath in the destination
Graphics object before drawing the bitmap.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the number 3
|
|
|
|
|
I have a dialog-based program,
I want to draw my own title bar,so I completement ON_WM_NCPAINT() message of the dialog.
In the OnNcPaint() funtion,I wrote:
CDC* pDC=GetWindowDC();
CDC memDC;
BOOL ret=memDC.CreateCompatibleDC(pDC);
int nSaveDC=pDC->SaveDC();
CBitmap bmp;
ret=bmp.LoadBitmap(IDB_LOGIN);//IDB_LOGIN is a bitmap resource ID
memDC.SelectObject(&bmp);
CRect rc;
GetWindowRect(&rc);
ScreenToClient(&rc);
ret=pDC->BitBlt(0,0,rc.Width(),m_captionRect.Height(),&memDC,0,0,SRCCOPY);
bmp.DeleteObject();
ReleaseDC(&memDC);
pDC->RestoreDC(nSaveDC);
the code works well when the dialog was shown first time,but when the dialog should be redrawn,the title bar went back to its default look(the blue bar).
Someone would like to tell me why?And how to resolve it?
Thanks.
GOOD LUCK.
|
|
|
|
|
i am not sure but it sounds like you need to send an update to your non-client area
Yours Truly, The One and Only!
|
|
|
|
|
Thanks.
Now,it works well.But if you would like to tell me how to make the client area's left-bottom and right bottom is round conor?
|
|
|
|
|