|
Try __LINE__ for the source code line. __FILE__ might also be of interest - this is the source filename.
Hope this helps!
|
|
|
|
|
Thank you... that work fine...
Hello World!!!
from Raphaël
|
|
|
|
|
is there some easy (or not way to download file
from net, when i have url to it?
I'm interesting in C or C++ implementation on non
blocking sockets
(or simple idea how 2 do it)
Pawel
|
|
|
|
|
hehe
i reply to myself
If anybody will be interesting, here are quite nice articles about blocking & non-blocking sockets.
1) http://klement.dstorm.net/rpg/socktut/x1152.html
2) http://www.developerfusion.com/show/28/8
Take care
|
|
|
|
|
i have made tabs in SDI, now i want to make tabs inside the tab which is displayed on my SDI.
refer me the code or website, where i can get appropriate help.
thanx
Reply me soon
|
|
|
|
|
I have a dialog box with various buttons and controls on it, as well as a static text box which is used as a placeholder, and in code it creates a propertysheet where the static text box is. I set my desired tab order, with the static text box as #13 in the tab order. But instead of tabbing off the #12 order (a button) and going to the propertysheet's active tab/page, it goes to the #14 control (a listview), then, at the end of the ta order sequence, ends up on the propertysheet. Is there a way I can set the tab order so that the tab order is properly set, so that the propertysheet is #13 in the tab order? Thanks!
|
|
|
|
|
Check out CWnd::SetWindowPos() - I think that might do the trick!
|
|
|
|
|
I looked up SetWindowPos in MSDN, and tried a few things, but none of them affected the tab order from the dialog controls to the propertysheet, and the propertysheet is last in the tab order.
Here is the code I use to create the propertysheet dynamically, IDC_PPS_MAIN is a dialog resource, m_ppsMain is a CPropertysheet object. This code is ran in a dialog in its OnInitDialog() function:
<br />
m_ppsMain.Create(this, WS_CHILD | WS_VISIBLE, 0);<br />
m_ppsMain.ModifyStyleEx(0, WS_EX_CONTROLPARENT);<br />
m_ppsMain.ModifyStyle(0, WS_TABSTOP);<br />
<br />
CRect rcSheet;<br />
GetDlgItem(IDC_PPS_MAIN)->GetWindowRect(&rcSheet);<br />
ScreenToClient(&rcSheet);<br />
m_ppsMain.SetWindowPos(NULL, rcSheet.left- 7, rcSheet.top - 7, 0, 0,<br />
SWP_NOZORDER | SWP_NOSIZE);<br />
<br />
m_ppsMain.SetActivePage(1);<br />
m_ppsMain.SetActivePage(2);<br />
m_ppsMain.SetActivePage(3);<br />
m_ppsMain.SetActivePage(4);<br />
m_ppsMain.SetActivePage(0);<br />
|
|
|
|
|
Make sure that the property sheet/pages have the 'control' style set. This style (DS_CONTROL) tells Windows to include them in the tab order of their parent window.
Software Zen: delete this;
|
|
|
|
|
Anybody know about mirring the display driver? Can we assiciate the mirror driver with virtual deskop. I meant no other driver need to active in virtual desktop. Is it possible?
vikrams
|
|
|
|
|
Just a question about good practice.
Is it reasonable to rely upon the order of destruction of a group of objects within another object? Especially in regard to exception safety and readablity.
Specifically. I'm using CComPtr's to attempt to make some of my DirectShow code as exception safe as possible. I've realized that just releasing the interfaces that occurs in the CComPtr's destructors aren't enough if an exception is thrown, and that the whole filter graph needs to be torn down first.
I'm going to put the tear down operation in an another class, and instantiate it on the stack, but I need the destructor of that object to be called before all of the CComPtr's destructors are called.
I ?think? destructor order is controlled by declaration order, but in general is relying upon that fact good practice?
Any help would be appreciated.
Andrew
|
|
|
|
|
walker_andrew_b wrote:
I ?think? destructor order is controlled by declaration order, but in general is relying upon that fact good practice?
It's specified by the language so it's probably not unreasonable
Not everyone knows that so if your code absolutely relies upon it, a comment to that effect is probably in order.
Software is everything. It also sucks. Charles Fishman [^]
Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
walker_andrew_b wrote:
I ?think? destructor order is controlled by declaration order,
Yes, it is. More specifically, order of creation (just in case you're using pointers to allocate memory dynamically).
walker_andrew_b wrote:
is relying upon that fact good practice?
It's smart, but how will you remember that two weeks from now. If the workaround is difficult, use this by all means, but COMMENT IT!
Vikram.
-----------------------------
1. Don't ask unnecessary questions. You know what I mean?
2. Avoid redundancy at all costs.
3. Avoid redundancy at all costs.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
Vikram Punathambekar wrote:
It's smart, but how will you remember that two weeks from now. If the workaround is difficult, use this by all means, but COMMENT IT!
Well, it's written, or at least a big part of it is.
The whole reason I headed down this path was to make sure that the classes were exception safe. I've been looking into the Herb Sutter's material (Exceptional C++), and this way seems to be the only way to make any kind of exception safety guarantee. I never realised how much extra work it was going to be, nor the compromises that would have to be made.
Doing proper exception handling is so hard
Thanks for the feedback though
|
|
|
|
|
hey people
have taken your advice, but it just won't work, keeps coming up with the error in the subject line. any help would be truly appreciated..
here's what the code looks like:
#include "stdlib.h"
int* CreateArrayOfRandomNumbers(int nSize)
{
int* pArray = new int[nSize];
if( NULL == pArray );
return NULL; // memory allocation error
for( int i=0; i);
{
pArray[i] = rand();
}
return pArray;
}
|
|
|
|
|
your "if" and "for" statements don't need a semicolon at the end.
in this particular case, it shouldn't cause the error you re getting but you never know try fixing that first.
Software is everything. It also sucks. Charles Fishman [^]
Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.
|
|
|
|
|
thanks i'll try that..
|
|
|
|
|
Taka Muraoka wrote:
"if" and "for" statements don't need a semicolon at the end
Seriously, be more specific- you shoulda prolly said "shouldn't have a semicolon". OK, OK, you can have empty for loops, but empty if blocks IMO should never be used.
Vikram.
-----------------------------
1. Don't ask unnecessary questions. You know what I mean?
2. Avoid redundancy at all costs.
3. Avoid redundancy at all costs.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
I presume you've just included a snippit of the whole file there. This error is often caused by mismatched braces further up the file where you have one more open brace than you have close braces.
For example :
void MyFunction1()
{
void MyFunction2()
{
}
|
|
|
|
|
Remove the semicolon at the end of this statement:
if( NULL == pArray );
There is a misplaced semicolon in this statement (or you got bite by HTML formatting):
for( int i=0; i);
int *CreateArrayOfRandomNumbers(int nSize)
{
int *pArray = new int[nSize];
if( NULL == pArray )
return NULL;
for (int i = 0; i < nSize; i++)
pArray[i] = rand();
return pArray;
}
|
|
|
|
|
|
Anyone heard bout 'Scene Structure' ?
How to construct Scene Structure from a bitmap ?
If possible please provide me the algorithm or source code, thank you.
|
|
|
|
|
#include <fstream.h>
ifstream in("test.oop");
Is causing problems...how do I fix this...?
i'm getting an 'ifstream' : ambiguous symbol error???
Thanks in advance
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Add using std::fstream.
Kuphryn
|
|
|
|
|
Hi guys,
I'm implementing zmodem class which is downloaded from another site, programmer's heaven. I'm implementing that class in VB for my project work.
I'm not expert in VC++, but I'm able to convert the VC++ DLL into VC++ OCX and using that OCX in VB project. I made OCX cox, I need to use the same in PowerBuilder too.
I exposed 3 methods InitCOMM(), SendFiles(), ReceiveFiles() to use in VB.
The handle in VC++ classes for writing and reading COM port is defined as void *, and exposed them as long int.
I established the connection between 2 computers using MSCOMM control in VB, and passed the MsComm1.COMMID to the InitCOMM() method to initialize the zmodem class. Now, it gives automation error when I use Send/Receive functions, .. the vc++ WriteFile() always fails to write to COM port in I/O overlapped mode.
Can any one help me, how to get rid of this or any other solution for ZModem implementation.
thanks in advance
=========================
http://www.weilersplace.de/dl/zmodemclass.zip
===========================
Nathani,
Sr. Programmer
|
|
|
|