|
Hi, all
I need to Put a Break Point in MFC source file DLGDATA.CPP, but while I am in my own application, how could I do that?
the reason I need set breakpoint is I have those warning:
Warning: skipping non-radio button in group.
thanks
|
|
|
|
|
Hi,
just open the DLGDATA.CPP in your \Microsoft Visual Studio\VC98\MFC\SRC\ folder
and set your breakpoint by using the context menu.
I tried it in
HWND CDataExchange::PrepareCtrl(int nIDC)
and it worked, but I think this code shouldn't be too buggy...
Regards
|
|
|
|
|
|
valerie99 wrote:
the reason I need set breakpoint is I have those warning:
Warning: skipping non-radio button in group.
To eliminate the warning, you need to do the following:
1) Edit your dialog template and make sure every radio button group has all its individual radio buttons in consecutive tab order
2) Make sure the first radio button in each radio button group has the group style
3) Make sure every other radio button in the same group has not the group style
4) The first control after (in tab order) the last radio button in a group has the group style (if the last radio button in a group is also the last control in the dialog, set the group style to the first control)
After doing this, you'll have not only eliminated the warning, but also made sure your buttons will behave as expected (i.e.: you can navigate them in proper order using the tab key, and clicking one of them will deselect whichever one was selected in that group).
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
it was the #4, I check the group for the "The first control after (in tab order) the last radio button"...
okay, the last radio button is 13, the 14 is also in the group with 13, means I need to check 15 for the group, right? is 15 "The first control after (in tab order) the last radio button"?
after this, I still have a "Warning: dialog data checkbox value (40) out of range.".......you must know this one, too.....
thank you very much!
|
|
|
|
|
valerie99 wrote:
okay, the last radio button is 13, the 14 is also in the group with 13, means I need to check 15 for the group, right? is 15 "The first control after (in tab order) the last radio button"?
Assuming 13, 14 and 15 is the tab order, then yes, that's right.
valerie99 wrote:
after this, I still have a "Warning: dialog data checkbox value (40) out of range.".......you must know this one, too.....
That's a different problem.
This is the code in MFC's dlgdata.cpp (VC 6.0):
void AFXAPI DDX_Check(CDataExchange* pDX, int nIDC, int& value)
{
HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
if (pDX->m_bSaveAndValidate)
{
value = (int)::SendMessage(hWndCtrl, BM_GETCHECK, 0, 0L);
ASSERT(value >= 0 && value <= 2);
}
else
{
if (value < 0 || value > 2)
{
TRACE1("Warning: dialog data checkbox value (%d) out of range.\n",
value);
value = 0;
}
::SendMessage(hWndCtrl, BM_SETCHECK, (WPARAM)value, 0L);
}
}
As you can see, the warning is shown because the variable associated with a checkbox control has a value (40), which is not in the expected range (0..2) for a checkbox.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Dear Experts,
I need to compile an old project (built with VC++) in Visual Studio .Net
2003.
The project is going to build a DLL. When i try to compile the project, i
got the following errors:
c:\thepath\aaa.cpp(890): error C2065: 'm_nBackStyle' : undeclared identifier
c:\thepath\aaa.cpp(890): error C3861: 'm_nBackStyle': identifier not found,
even with argument-dependent lookup
c:\thepath\aaa.cpp(891): error C3861: 'm_nBackStyle': identifier not found,
even with argument-dependent lookup
c:\thepath\aaa.cpp(892): error C3861: 'm_nBackStyle': identifier not found,
even with argument-dependent lookup
in aaa.cpp, 'm_nBackStyle' are used as the following:
// Set up background mode.
890: if(m_nBackStyle != 1 && m_nBackStyle != 2)
891: m_nBackStyle = 2;
892: SetBkMode(di.hdcDraw, m_nBackStyle);
in aaa.h, i have:
#include <atlctl.h>
and aaa.h is already included in aaa.cpp.
I found the following declaration in ddd.h, which is in another project (the
solution has sevreal projects):
LONG m_nBackStyle;
Is it because my project is not set correctly? When i tried to open it in
Visual Studio .Net 2003, i was asked to transfer the project, i wonder if
after the transfer, the dependence relationship of the projects was lost.
I found some info about m_nBackStyle at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceatl/htm/cccontrl_72.asp
Could you please help me fix the problem.
Thanks!
vic
|
|
|
|
|
You're joking right ? Your files are called aaa.h and ddd.h ?
If you check 'Do not treat <'s as HTML tags' then we can see what your include was.
That link refers to the pocket PC sdk's, is this a pocket PC app ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian,
Thanks for your note.
I just wanted to explain my problem clearly, so i used a simple note for my files (as used aaa.h and ddd.h), it did not mean my file was exactly named in that way.
i am working on a Desktop computer.
Hope you can give me some suggestion to solve the problem.
Your help is highly appreciated!!!
Thanks!
vic
|
|
|
|
|
Interestingly, when I search the include folder on VC2003, I can't find m_nBackStyle. The VC6 atlctl.h contains it. However, unless your class is derived from CComControlBase, it doesn't matter, it wouldn't be able to see it. Is this your base class ? I guess so, from the include in your header file. It looks to me like this base class has changed a lot, so I reckon you've got your work cut out for you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
> Dear Experts,
>
> I need to compile an old project (built with VC++) in Visual Studio .Net
> 2003.
> The project is going to build a DLL. When i try to compile the project, i
> got the following errors:
>
> c:\thepath\aaa.cpp(890): error C2065: 'm_nBackStyle' : undeclared identifier
> c:\thepath\aaa.cpp(890): error C3861: 'm_nBackStyle': identifier not found,
> even with argument-dependent lookup
> c:\thepath\aaa.cpp(891): error C3861: 'm_nBackStyle': identifier not found,
> even with argument-dependent lookup
> c:\thepath\aaa.cpp(892): error C3861: 'm_nBackStyle': identifier not found,
> even with argument-dependent lookup
>
> in aaa.cpp, 'm_nBackStyle' are used as the following:
> // Set up background mode.
> 890: if(m_nBackStyle != 1 && m_nBackStyle != 2)
> 891: m_nBackStyle = 2;
> 892: SetBkMode(di.hdcDraw, m_nBackStyle);
>
> in aaa.h, i have:
> #include <atlctl.h>
> and aaa.h is already included in aaa.cpp.
>
> I found the following declaration in ddd.h, which is in another project (the
> solution has sevreal projects):
> LONG m_nBackStyle;
--------------------------------
Hi Christian,
Thanks a lot!
You are right, m_nBackStyle is in atlctl.h.
Please see the info about m_nBackStyle at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceatl/htm/cccontrl_72.asp
m_nBackStyle is defined in ddd.h, in another class, in another project, in the same solution. There are several projects in the same solution.
If it is because the projects dependence info was lost after i transfer the projects to VS .NET, how can i figure out the dependence relationship between the projects and recover that quickly?
Thanks for your valuable suggestion!
Vic
|
|
|
|
|
vic12000 wrote:
You are right, m_nBackStyle is in atlctl.h.
But ONLY in VC6. It's not there in VC7, at least I couldn't find it.
vic12000 wrote:
m_nBackStyle is defined in ddd.h, in another class, in another project, in the same solution.
If it's another project, I'm not sure how that matters.
vic12000 wrote:
If it is because the projects dependence info was lost after i transfer the projects to VS .NET, how can i figure out the dependence relationship between the projects and recover that quickly?
I reiterate - as it's a member variable, it needs to be declared in a class WHICH IS THE BASE CLASS for the class having the compiler error. I think that you are moving from VC6, where atlctl.h DID contain this variable, to a newer compiler, where it looks to me like it does not.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is it possible to change the media mode in the middle of a call using TAPI?
I am using the interactive voice mode to send DTMF but afer that i need to send data but if i try to use the lineSetMediaMode command to change to datamodem i get an invalid call state error.
Course theres another way of looking at it, you either can or can't change a modems mode from voice to data mid-call, or there is someway way of passing data to get round it.
thanks
|
|
|
|
|
I was just wondering what is actually returned by this function. In the documentation I find in the description that it returns the number of characters in the string, but the return value description says that it returns the bytes of the string...
which one is it?
|
|
|
|
|
It returns the number of bytes in the object. For Unicode, this is twice the number of characters.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Are you sure about this? I just tried it with VC6, and in a Unicode build, the code
CString strText = _T("abcde");<br />
<br />
long lLength = strText.GetLength();<br />
<br />
ASSERT(sizeof(TCHAR) == 2);<br />
ASSERT(lLength == 5);
does not ASSERT.
|
|
|
|
|
Graham Bradshaw wrote:
Are you sure about this?
No. I misread the help for GetLength() ; when it was talking about MBCS, I was seeing Unicode!
I guess if I had looked at some of my code first, this would have clued me in that it is the number of characters:
...str.GetLength() * sizeof(TCHAR);
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
It returns the number of bytes in the object. For Unicode, this is twice the number of characters.
Actually, for Unicode, the returned length is the count of WCHARs. In other words, it's always the length in TCHARs (bytes for non-Unicode, WCHARs for Unicode). So, CString(_T("Four")).GetLength() will always return 4, regardless of Unicode settings.
The semantics for CString::GetLength() are the same as for the lstrlen[^] function, which is used internally by CString implementation. For instance, see the implementation for CString::ReleaseBuffer() (VC 6.0)
void CString::ReleaseBuffer(int nNewLength)
{
CopyBeforeWrite();
if (nNewLength == -1)
nNewLength = lstrlen(m_pchData);
ASSERT(nNewLength <= GetData()->nAllocLength);
GetData()->nDataLength = nNewLength;
m_pchData[nNewLength] = '\0';
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
GetLength returns the following:
On ASCII strings: The number of BYTES which happens to be the number of characters.
On MBCS strings: The number of BYTES which is NOT the same as the number of characters. A character that requires two BYTES will contribute two to the total of GetLength.
On UNICODE strings: The number of WCHARs which is NOT the same as the number characters (UCS-4).
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
So if I want to be sure and in the end come out with a measure of the number of bytes (since I use this in conjunction with a filename buffer for a custom multiselect file dialog) what can I do? Is there some other way of finding out the length in bytes of a string?
In a compile-mode independant manner? I mean it seems clear that the object itself contains a buffer so it should also internally have a count of the bytes. Is this hidden? Because this behaviour from GetLength() seems to be a bit confusing...
(or maybe I am what is confused?)
|
|
|
|
|
hello 2 all,
for my project i need to build a firewall by-passer for windows (2k & above) based on exploiting port 80 (HTTP encapsulation). the session will be opened with an external decapsulating server that will forward the original message, get the response & send it back to the source.
first:
does anyone knows an application that does that (with open source)?
second:
i think my first thing to do is to capture the outgoing packet & change it's destination ip & port while saving the original data inside the packet.
so, how can i do that, change fields etc..
third:
i wellcome any other suggetions on ways to implement this project.
p.s:
i read a lot of the things this site has to offer, but it's all very confusing & since i'm a begginer i would appriciate any help.
thanks.
|
|
|
|
|
Why would one want to bypass a firewall, especially on port 80 ?
~RaGE();
|
|
|
|
|
because the firewall allowes only http, but what if you want ftp or other applications? how do you by-pass the firewall restriction?
|
|
|
|
|
You don't!
Bypassing a firewall is a bad idea in most cases. One way to do such a thing is to write a low level driver that sends the data itself. This means that you have to write a driver on a lower level than the driver that is hooked by the firewall.
I think that the best way to accomplish the bypass of the firewall restriction, is to use an unusual port number and to state explicitly that any firewall or router should forward that port.
Bypassing the firewall doesn't work only temporary (the vendors of the software will fix the problem one day), but I'm sure that clients of your program won't like that feature. Especially changing the IP packet and sending it to another location...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
first of all, thanks!
second, i'm not trying to bypass the firewall that is on the same host as the application. i'm trying to bypass the firewall that is on the LAN edge, probably on a router (my university firewall to be exact). i can't tell if it's a regular firewall or is it combind with a proxy but i have to make it work anyway.
third, i know i have to write a driver & i searched for samples/tutorials in many websites, including pcausa.com & msdn. but because i'm new to this, i probably missed it, cause i know it's there somewhere.
|
|
|
|
|