|
Muzammil Saeed wrote: Turbo v3.0
turbo v3.0 what ? if you're talking about Turbo C++[^], I'd ask my boss/teacher/company/school to move in the XXI century and at least get something like the Visual Studio Express.
Anyway, your error usually happens (at least for me) when the output file (in your case, File_Name.EXE) is locked by another process (for example if exe is opened, or previous compiler sessions crashed, ...)
Other than that, maybe check the project settings (if that exists with turbo ) to check the files and paths exist (maybe the compiler/linker is stupid and you manually need to create the folders), or if it's an old version, maybe it does not work with filename longer than 8.3 characters (DOS format).
Good luck.
This signature was proudly tested on animals.
|
|
|
|
|
It is used for educating the students simple c++, oop techniques and i think best in the business.
Anyways,thats right...my previous compiler session carshed. I had to kill the process(turbo c++). How to fix this problum??
|
|
|
|
|
Hello everyone here!!
I have an array of POINTs where X are represented by consecutive integers from 0 to n and Y are represented with RAND values...
So I represent this array on the canvas using PolyLine and I'm trying also to "rescaling" graphic when resizing window but it doesn't work... I have coded the OnPaint procedure like below:
void CMyDLL::OnPaint()
{
CPaintDC dc(this);
dc.SetBkColor(RGB(0,0,0));
CRect rect;
GetClientRect(&rect);
int save = dc.SaveDC();
if(bSetDraw)
{
CMemDC mDC(&dc);
mDC.SetMapMode(MM_ANISOTROPIC);
mDC.SetWindowOrg(rect.BottomRight());
mDC.SetViewportOrg(0, 0);
mDC.SetViewportExt(-1, -1);
mDC.SetWindowExt(1, 1);
if (bActivateGrid)
{
CPen qLinePen(PS_SOLID, 1, RGB(0,139,0));
mDC.SelectObject(&qLinePen);
mDC.MoveTo(1, 0);
mDC.LineTo(rect.Width(), 0);
int height = rect.Height();
int maxlines = height / (int)12.5;
for (int i=1;i<=maxlines;i++){
int y_axis = (int)((double)i * 12.5);
if (y_axis <= rect.Height()) {
mDC.MoveTo(1, y_axis);
mDC.LineTo(rect.Width(), y_axis);
}
}
mDC.MoveTo(0, 0);
mDC.LineTo(0, rect.Height());
int width = rect.Width();
maxlines = width / (int)12.5;
for (int i=1;i<=maxlines;i++){
int x_axis = (int)(((double)i * 12.5) - gridOffset);
if (x_axis <= rect.Width()) {
mDC.MoveTo(x_axis, 1);
mDC.LineTo(x_axis, rect.Height());
}
}
qLinePen.DeleteObject();
}
CPen qPolylinePen(PS_SOLID, 1, RGB(0, 255, 0));
switch (iGraphType)
{
case GRAPH_BARS:
break;
case GRAPH_LINES:
{
if (vtPoints.capacity() == 1)
{
mDC.SelectObject(qPolylinePen);
vectfPoints* pointsline = &vtPoints[0];
mDC.Polyline(&(*pointsline)[0], (int)pointsline->size());
qPolylinePen.DeleteObject();
}
}
break;
default:
break;
}
GDI_FLUSH();
}
dc.RestoreDC(save);
}
Could I have forgot something? Or coded wrong something else in this code?...
Thanks in advance to everyone
Ciao, Luigi
|
|
|
|
|
npuleio wrote: but it doesn't work...
What does it mean, exactly (i.e. please, be specific)?
Moreover, maybe I'm wrong, but I don't see any 'rescaling' in your code.
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]
|
|
|
|
|
First, thank you CPallini for your answer,
I as asking because I supposed using MM_ANISOTROPIC and setting SetWindowExt and SetViewportExt to (1, 1) and (-1, -1) I just let the device context doing the hard stuff like doing the manipulations required to get from data point to the window's canvas...
Maybe shall I have to call some other functions to re-scale the graphic when repainted?...
Thanks again
Ciao, Luigi
|
|
|
|
|
I *can* see some scaling in your code. Viewports etc are a bit mind-bendy to work with. This article should help you with testing out combinations:
The ViewPort Explorer[^]
Saved me a lot of headache when I was doing an almost identical task to yours.
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: I *can* see some scaling in your code.
Wow, I suppose scaling input-data-dependent, I can't see such a dependence in his code. However this is going...
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]
|
|
|
|
|
Well, us warriors have superb eyesight...
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: I have now moved to Sweden for love
Iain Clarke, Warrior Programmer wrote: us warriors have superb eyesight...
For sure!
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]
|
|
|
|
|
Hello Iain,
I tried that Viewport of Joseph Newcomer and I would say in the array I'm using consecutive integers as X coordinates like 1,2,3,4,...,n...so in SetWindowExt, which should be the interested method for re-scaling I guess, I use current last X value in the array for X coord and in the place of Y I use rect.bottom since Y values in the array are actually random with this formula:
myarray[i].y = (LONG)( (double)rand() / (RAND_MAX + 1) * (rect.bottom
- 1) + 1 );
(the array is fixed size to the whole window resolution width where when I add new value at the last place I rotate before the array to shift-left it).
The matter is if I set SetWindowExt with last myarray[myarray.size() - 1].x and rect.bottom, which would be reasonably the right way to set for rescale, produces an assertion error.
Using Newcomer's Viewport example I found on codeproject, i figured to set the origin at bottom right having axis going back to bottom-left and top-right it made me setting SetViewportOrg and SetWindowOrg respectively to 0,0 and rect.BottomRight() so it would start from bottom-right... and setting SetWindowExt to rect.Width() and
rect.Height() didn't produced any assertion errors but doesn't repaints rescaled graphic. You can see the two results here:
http://img707.imageshack.us/img707/3444/44318805.jpg <---- this is the
control minimized
http://img16.imageshack.us/img16/4699/64174798.jpg <---- this is the
control maximized
Maybe I haven't got well in my mind about right settings of those
SetWindowOrg, SetWindowExt, SetViewportOrg, SetViewportExt...
Any suggest?...
Thanks
Ciao,
Luigi
|
|
|
|
|
please any one tell can we connect can we connect win32 socket in client side with CSocket class in server side????
if u give answer with sample code means i will be more happy..
thanks in advance....
|
|
|
|
|
thangvel wrote: please any one tell can we connect can we connect win32 socket in client side with CSocket class in server side?
Yes, at the network level there is only one type of socket, and a CSocket is merely a C++ wrapper class for the basic socket mechanism.
thangvel wrote: if u give answer with sample code means i will be more happy
Unfortunately, you are going to be less happy. If you want source code you need to search the articles for samples; there are many.
MVP 2010 - are they mad?
|
|
|
|
|
There is no particular requirement on the Win32 socket connection, if in the other side there is a CSocket .
So just have a look at the documentation [^].
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]
|
|
|
|
|
Sure. A socket is totally ignorant of what language dll is on top of it.
You could connect one end in VB to another in Java.
Morality is indistinguishable from social proscription
|
|
|
|
|
thangvel wrote: can we connect win32 socket in client side with CSocket class in server side
Yes you we can.
thangvel wrote:
if u give answer with sample code means i will be more happy
I would not use the class CSocket instead use CAsyncSocket or something else. Have a look at Beej's guide to networking programming[^] and Winsock Programmer's FAQ[^], there are client/server examples in section 6. You can download, modify it and play with it.
Hope it helps!
/M
|
|
|
|
|
To get disk number for any drive i open drive (like \\.\c and pass its handle with IOCTL_STORAGE_GET_DEVICE_NUMBER in DeviceIoControl and get data in STORAGE_DEVICE_NUMBER structure. This structure returns the device number and partition number.
This works perfectly on basic disk but when i use the same on dynamic disk then it's fail.
Please suggest how to get disk number and partition number for dynamic disk.
|
|
|
|
|
u can try with this IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS structure.
it gives pratition number.
like this,
VOLUME_DISK_EXTENTS pdg;
....
DeviceIoControl(...,IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,...);
....
pdg.Extents->DiskNumber;
thats it.
Regards,
Srinivas
|
|
|
|
|
Thanks
After using that i get correct disk number. But i found starting offset and extent length different.It shows very large value for starting offset.And extent length shows a value(0x7e00) which is the position in disk from where this partition start.
Does extentlength means total size of drive or position of drive in disk?
typedef struct _DISK_EXTENT {
DWORD DiskNumber;
LARGE_INTEGER StartingOffset;
LARGE_INTEGER ExtentLength;
} DISK_EXTENT, *PDISK_EXTENT;
typedef struct _VOLUME_DISK_EXTENTS {
DWORD NumberOfDiskExtents;
DISK_EXTENT Extents[1];
} VOLUME_DISK_EXTENTS, *PVOLUME_DISK_EXTENTS;
|
|
|
|
|
u can get size of disk like this,
ULONGLONG ulLength = pdg.Extents->ExtentLength.QuadPart;
Regards,
Srinivas
|
|
|
|
|
I have two doubts regarding ur question
1. If DeviceIoControl API is failing, can you check error with GetLastError API([^]).
2. What type of dynamic device you are using and hope it comes in one of the define type([^])
Величие не Бога может быть недооценена.
|
|
|
|
|
Hi all,
I have made a simple Dialog box application, in that i have made a static text control with Client Edge properties true and i also have a picture control which has a bitmap. That picture control is below that static control to give a look that bitmap inside that static control border. but the problem is sometimes that bitmap is not displayed i have also used Invalidate(False) everytime i have displayed both the controls but sometimes only static box is displayed and picture is not displayed...
How can i show it..
thanks in advance
|
|
|
|
|
May be you have to properly set the tab order. You can press Ctrl + D on resource view of dialog and see/modify tab order.
|
|
|
|
|
Static control tab should be first or picture control tab
|
|
|
|
|
I think static control should come before the picture box in tab order. I mean if static control's tab order is 1 then picture control's has to be 2.
|
|
|
|
|
still not visible sometimes....
|
|
|
|