|
I'm attempting to implement an IP tunneling protocol via TCP/IP on Windows XP platforms. Yeah I know, re-inventing the wheel, but please bear with me. Anyway, the tunneling protocol not only needs to redirect the packets but it needs to modify packet contents and yet be as transparent as possible. The worst part of it all is that I will have to use a pre-compiled DLL to perform certain operations while having no idea how the DLL performs those operations. No, I don't have access to the DLL's code.
I initially thought of implementing it via NDIS drivers, but they run in kernel mode and there isn't any documented way for them to communicate with user-mode processes that I will require to make use of the DLL. There is a way, but it is undocumented which is why I'm shying away from this method.
The other method that I thought of involves creating a tunneling server service coupled with a tunneling client service. The problem here is that I have to intercept IP packets on the client machines and then modify and forward them through the client service. I would also have to add NAT features to the server service. Which I wouldn't have to do using NDIS drivers because they have complete access to the packets before they are sent and I can have Internet Connection Sharing do the NAT work. I was told that it is possible to intercept the IP packets via Windows Sockets but this is unexplored territory for me. I also remember messing with an application running on a Win9x platform which allows the use of a SOCKS proxy for programs which does not include SOCKS support. I suppose the concept is the same, but then again that was Win9x.
I'm more inclined to do the 2nd method since it sounds safer hehe. But I was hoping for a solution that would feel like I'm using the Virtual Private Network implementation built into Windows XP machines. Unfortunately, I simply can't use the MS VPN because of the proprietary design of the protocol I'm supposed to implement.
Right now, I'd be satisfied with information regarding packet interception and modification via Windows Sockets, but I'd be very greatful if someone could come up with a better implementation method.
|
|
|
|
|
How to create dialog to select folder??
|
|
|
|
|
SHBrowseForFolder
modified 12-Sep-18 21:01pm.
|
|
|
|
|
FOr some reason, every time I start my app, the compiler disables my breakpoints, thus I cant debug the way I want.
Any ideas why this is happening?? I'm using VS6.0
-C
|
|
|
|
|
Are you positive that when you built the app you built it in debug mode? I have forgotten that I had built an app in release mode and tried to debug it and received similar results as you have described.
|
|
|
|
|
Yes its in Debug mode, but I know I've debugged in Debug and Release. Just seems odd that I cant set breakpoints now.
-C
|
|
|
|
|
Most likely, you are looking at the wrong code (you might have another copy of your binaries that is being executed).
|
|
|
|
|
Try putting
int asm 3;
in your code
/* Let it ignore that!*/
|
|
|
|
|
Check that in project->settings c/c++ tab debug info is set to 'program database' optimization to 'disable(debug)' and in link tab chaeck 'Generate debug info'
--PM
|
|
|
|
|
Is the code in a DLL that you are trying to debug? If so, build and run the DLL pointing at the appropriate .exe should do the trick.
Ant.
|
|
|
|
|
How about deleting the .pdb file?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have an application that uses wininet HttpSendRequest and InternetSetOption to send a digital certificate when sending a request to a site for authentication. Everything works great on my development PC, but when we try to run it on a server with Windows Server 2003 HttpSendRequest returns 12157 ERROR_INTERNET_SECURITY_CHANNEL_ERROR.
Both are using the same digital certificate imported using the import wizard in and are located in the same store.
I have searched Microsoft's site for the error, but have not been very successful. I find items for Windows CE, but nothing else.
Does anyone have any insight on this problem?
|
|
|
|
|
I am trying to remove a child window title bar at run time. I have tried it statically using Properties, but it returns, with a title, each time I run the application. How can I remove it?...and I would like to find out how it is being created at run time. Not sure where to look in the code.
Thanks.
Jerry
|
|
|
|
|
have you tried removing the WS_CAPTION style from the window long parameter? That is how the title bar gets added. If you use a style like WS_OVERLAPPED, it is a predefined style that includes the caption as well as others like the border and sysmenu.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Actually my project is a SDI with a view and doc. It is the title for the view window which is giving me trouble.
Jerry
|
|
|
|
|
I am not sure where you are refering.
You have an SDI app, and that window will have a caption.
Is there another child window, and where is it?
Also, have you used Spy++ to look and the window styles to see if this child window you are refering to uses the WS_CAPTION style? Have you tried removing that style from this window in question?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
I have a class (CVidCap) that I developed to grab frames from a Webcam and I want to make this a "dialog independent" class. When this class is created it populate a CMenu (MFC) object with all Webcam available in the system and i design a function that append this CMenu object in an application MenuBar. The problem is that when the CMenu object is attached, it is alweys GRAYED, and I can't handle any mouse button press in my class.
I'm trying to handle the application events in my independent class without insert any code in the application MESSAGE_MAP. I was clearly?
<br />
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)<br />
ON_COMMAND(ID_TESTE_B, OnTesteB)<br />
END_MESSAGE_MAP()<br />
I try to add a message map in my class but didn't work.
If anybody could help, I'll appreciate!
Thanks, and sory my english!
Marcos Vinícius
Engenheiro Eletricista
|
|
|
|
|
Like this?
pMDIFrame->GetMenu()->>AppendMenu(MF_SEPARATOR);
pMyMDIFrame->DrawMenuBar();
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Yes, I try this, but the menu that I append is still grayed!!!
CMenu *Menu = Wnd->GetMenu();<br />
hr = Menu->InsertMenu(Position, MF_BYPOSITION | MF_STRING | MF_POPUP |<br />
MF_ENABLED, (UINT)DevicesMenu->m_hMenu, TEXT("Devices"));<br />
Menu->Detach();<br />
Wnd->DrawMenuBar();
The only way that they work properly is to add in the AppClass file MESSAGE_MAP the code:
<br />
BEGIN_MESSAGE_MAP(CTe13App, CWinApp)<br />
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)<br />
ON_COMMAND(ID_PAUSE, OnPause)<br />
ON_COMMAND_RANGE(ID_MENU_DIALOG0, ID_MENU_DIALOG9, OnDialog)<br />
END_MESSAGE_MAP()<br />
but I don't want to do this. I need to be App independent; to be an independent class!! Is there a way that adding a message map in my class, the app message map understand? Like this:
// file "MyClass.cpp"
BEGIN_MESSAGE_MAP(CVidCap, CWnd)
ON_COMMAND_RANGE(ID_MENU_DIALOG0, ID_MENU_DIALOG9, OnDialog)
END_MESSAGE_MAP()
Thanks
Marcos Vinícius
Engenheiro Eletricista
|
|
|
|
|
It is not neccessary to have your handler in your app class.
For instance, you can catch your menu item handler in your View.
You can have it in your CDialog , CView or CFrameWnd. Just make sure your menu ID constant to be included in the source.
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
It means that I always have to put some extra-code in my CDialog, CView or CFrameWnd? I can't just make an object that handle the menu messages without put any extra-code?
<br />
...<br />
private:<br />
CMyClass *MyObject;<br />
...<br />
<br />
...<br />
BOOL MyApp::InitInstance()<br />
{<br />
MyObject = new CMyClass();<br />
...<br />
}<br />
Thanks Anthony
Marcos Vinícius
|
|
|
|
|
Yes, it is possible, just that you need put in some effort.
Check Programming Windows by Charles Petzold.
|
|
|
|
|
Hello:
I´m programming my application with MFC from VC++. Unfontunly, I have a serious memory problem in my application. with every each any operation the memory grows 4k. Also, the application has to make a big numer of operations, So the memory grows until the application crash.
Any operation is made in a separate thread. The thread is created and later destroyed after each operation. It uses a pointer which references the ado connection. The entity of the connection is created in the main thread. Inside the thread, I create , open, use and close a new Recorset. The recorset uses the connection pointer to access the database.
The creation and destruction of the thread is fine, because in operations without recorset, the memory is stable. However, the threads that use recordset prevent the memory being released appropiately.
This is the code that i use to create the connection:
_ConnectionPtr pConn;
pConn.CreateInstance(__uuidof(Connection));
pConn->ConnectionTimeout = 180;
pConn->CursorLocation = adUseServer;
//open conexion
BOOL aux = S_OK == pConn->Open( _bstr_t(m_conexion) , L"", L"",adOpenUnspecified);
This is the code that i use to create the recorset:
//******
_CommandPtr pCmd_SP;
pCmd_SP.CreateInstance(__uuidof(Command));
//establezco conex con comando
pCmd_SP->ActiveConnection = pConn;
// seteo sql
CString instruccion = "execute storeprocedureX";
pCmd_SP->CommandText = (_bstr_t) instruccion ;
// Create the variant NULL
_variant_t vNull;
vNull.vt = VT_ERROR;
vNull.scode = DISP_E_PARAMNOTFOUND;
// creo el Rs
_RecordsetPtr pRs_SP;
pRs_SP.CreateInstance(__uuidof(Recordset));
pRs_SP->CursorLocation = adUseClient;
pRs_SP->PutRefSource(pCmd_SP);
// Open the recordset
pRs_SP->Open(vNull, vNull, adOpenForwardOnly, adLockOptimistic, adCmdUnknown);
pRs_SP->Close();
Would you please help me to solve this problem?
Thanx
|
|
|
|
|
To add information, now , i´m looking that the application grows 4k(in ram memory) with each: pConn->Execute(.....); , that happend when the execution is inside a child thread, but not when it´s in the main thread.....
I don´t know realy how to clean the memory....
|
|
|
|
|
To Add intormation I´ve posted here: http://www.codeproject.com/threads/work_queue.asp#xx814717xx
PLEASE I NEED A SOLUTION!!!!
|
|
|
|