|
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.
|
|
|
|
|
avi-wildthing wrote:
nd, i'm not trying to bypass the firewall that is on the same host as the application
If you fireWall Allow you to communicate on Port 80 without problem, Then why not you simply use available WinInet Api! / Wrappers
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ndis protocol driver is what you need.
Look at the windows 2003 DDk. There are samples there.
For out going packets you will need to change the TCP/UDP port address to the one you want, ie, the one blocked by the firewall.
For incomming packets change it back to the allowed port.
Make sure you driver sits between the NCI driver and tcpip.sys.
Now, to write the driver. Its a pain in the arse. It will take you about 6 months.
You will need to have 2 pcs to do the debugging over a serial link, to fix the 1000 blue screen your code will generate!
But, one you get it working it is very satisfying!
Nunc est bibendum!
|
|
|
|
|
Hi,
Does anyone know how to use hooking ?
For example: I think we can set up a hook to detect when a window of MSn messenger closes or starts.
Thanks
Preeti9
|
|
|
|
|
|
Can you please suggest me if hooking is a good approach to detect when a window starts and when it closes ?
Thanks
Preeti9
|
|
|
|
|
Preeti9 wrote:
Can you please suggest me if hooking is a good approach to detect when a window starts and when it closes ?
Yes I do think so. It is actually the only way to detect in the background if a window starts or closes.
~RaGE();
|
|
|
|
|
Thanks for the reply...
What if I use IsWindow function and then use while loop and at the end give sleep of like 1/2 a second....
Here is my program:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CTouchScreenAPI* pTouch;
// HWND hCalWin;
// DWORD SYNCRONIZE;
// DWORD procId;
HANDLE hProcess;
DWORD dwWaitResult;
pTouch = CTouchScreenAPI::Create();
if (pTouch)
{
if (pTouch->Init())
pTouch->Recalibrate();
else
MessageBox(NULL, "Created touchscreen interface OK, but Init() failed", "Info", MB_OK);
HWND hCalWin = ::FindWindow(pszABSPOINT_WND_CLASS_NAME, NULL);
//GetWindowThreadProcessId(hCalWin, &procId);
// retrieves the identifier of the thread that created this window.
// hProcess = OpenProcess(SYNCHRONIZE, FALSE, procId); //returns a handle to an existing process object
// Create top window class
//WinClass wc(ID_MAIN, hInstance,MainWndProc);
//hCalWin = wc.GetRunningWindow ();
// Is there a running instance of this program?
if (hCalWin !=0)
{
if( IsWindow(hCalWin) )
GetWindow(hCalWin, nCmdShow ); // handle of original window // relationship flag
//hCalWin->ShowWindow(SW_SHOW);
ShowWindow (hCalWin, SW_RESTORE);
while (1)
{
Sleep (1000);
}
return 0;
}
while (1)
{
dwWaitResult = MsgWaitForMultipleObjects(1, &hProcess, FALSE, 30*1000, QS_ALLINPUT);
if (dwWaitResult == WAIT_OBJECT_0 + 1)
{
MSG xMsg;
while (PeekMessage(&xMsg, NULL, 0, 0, PM_REMOVE))
{
if (xMsg.message == WM_QUIT)
return 1;
TranslateMessage(&xMsg);
DispatchMessage(&xMsg);
}// end of PeekMessage while loop.
int i=1;
while (i<10000)
{
i=i++;
}
}
else if (dwWaitResult == WAIT_TIMEOUT)
{
SendMessage(hCalWin, WM_CLOSE, 0, 0);
//TerminateProcess(hProcess, 0);
break;
}
else dwWaitResult == WAIT_OBJECT_0;
{
//Calibration process completed;
break;
}
}
}
else
{
MessageBox(NULL, "Unable to get pointer to Touchscreen interface", "Info", MB_OK);
}
return 0;
}
Help
Thanks
Preeti9
|
|
|
|
|