|
Thanks for your prompt reply.
I'm not sure if that's what I want really.
What I really want my app to do, is watch the modem for a remote connection (company dialling in), then when it sees a connection, to disable the LAN.
Obviously when they disconnect to re-enable the LAN.
Thanks
Steve
|
|
|
|
|
Does anyone know how to go about disabling a network adapter.
I just want to do want your able to do if you right click on you network connection in the tray.
Steve
|
|
|
|
|
try [NETSH]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hello,
i try to put a working code snip from an mfc .exe project into a .dll project. In the code an EVENTSINKMAP is linked to an activex control in my "old" mfc exe. The .dll should start working when an event occures from this activex control:
BEGIN_EVENTSINK_MAP(CSavepmjxApp, CWinApp)
ON_EVENT(CSavepmjxApp, IDC_SCANCONTROL, 1 , OnScanReadyRealscan1, VTS_UNKNOWN)
END_EVENTSINK_MAP()
The compiler gives an error because IDC_SCANCONTROL is unknown in my .dll project.
I like to use this .dll later in VisualBasic where i have my activex control again. How can i make this work??
happy coding,
-mark
|
|
|
|
|
I have failed to set the bi-directional bit of the parallel port using the "inpout32.dll". Each time I write to the control port a value that would translate to setting the bi-directional bit to "1", the value that is ultimately written is one which does not set the bi-directional bit. E.g. writing "32" to the control register which would translate to the bi-directinal bit being set to "1", results in "192" being written to the control register. "192" is a value which when converted to binary results in the bi-directional bit not being set. Any idea to what the problem might be?
So help me God!
|
|
|
|
|
I'm building a treeview in a virtual CListCtrl, i've got almost everything working except for one thing:
When you click an item in a listview it gets selected on the mouse down.
When you click a node in a tree view it gets selected on the mouse up.
This means that when you drag an item from the listview you're always dragging the selected item.
But in a treeview you can drag an item that is not the current selected item. And when you're done dragging the selected item becomes active again.
So what i'm looking for is a way to disable the item select in a listview on the mouse down.
Can anyone help me?
|
|
|
|
|
In C++ language, is there a command to convert ASCII to HEXADECIMAL value? Like 'atoi', whereby this is a conversion from ascii to ingteer !!!! So, anyone pls know, pls reply. Thanks!
|
|
|
|
|
Have a look at
this[^] thread. You might also want to try searching previous post if this doesn't help.
If all else fails, clarify your question and we should be able to help further.
I Dream of Absolute Zero
|
|
|
|
|
There's no such thing as converting ASCII to hexidecimal. One is not like the other. Perhaps you wanted to know how to convert from base 10 to base 16.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hello Techies,
How can I retrieve the path from where the application is being executed? This path should be retrieved at the initialization process itself.
Thank you,
Bye
Neelesh Jain
|
|
|
|
|
Use GetModuleFileName , passing NULL in for the hModule parameter.
|
|
|
|
|
Thank you Graham, But when I used the above function in the following way
GetModuleFileName(NULL,LPTSTR(path),1000);
It gave me an memory exception mentioning that it cann't read the memory.
path is a type of char pointer.
I had declared path as char* path;
|
|
|
|
|
It sounds as if you haven't allocated the memory - GetModuleFileName won't do that for you.
Try:
char path[1000];<br />
GetModuleFileName(NULL, path, 1000);
This statically allocates 1000 characters for the path variable.
|
|
|
|
|
Hi Graham,
Thank you for ur suggestion, its working, but its retrieving the file name also. I want to know only the path. For eg., If the application is present in C:\my document\Testing, then its displaying as C:\my document\testing\Test.exe
but i want to display only C:\my document\Testing. The application file should be displayed.
Bye
Thank you once again
Regards,
Neelesh
Neelesh Jain.
|
|
|
|
|
The easiest way to do this is to parse the returned string and find the last '\'. If you terminate the string there you will get just the path as you require.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
You should process yourself. Just find the last \ and extract the left before that.
|
|
|
|
|
|
use _tSplitPath api,that may help you in above cause
and for removing '\' use CString::trimRight function
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I display HTML reports in a CWebbrowser2 control embedded in my dialog based app. I also draw graphs within it using DHTML. They will only print if "Print Background Colours and Imgages" is set within Internet Options in the control panel. Is there a way I can set this for just the webbrowser control and not globally?
TIA
I feel like I'm diagonally parked in a parallel universe
Jerry Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Hi all
I tried to use CursorClip to limit my drawing region on SDI. Any easier way to do that? I need to limit my drawing region to a rectangle (400x400 pixels).
Thanks;)
|
|
|
|
|
RECT rcClip; // new area for ClipCursor
RECT rcOldClip; // previous area for ClipCursor
// Record the area in which the cursor can move.
GetClipCursor(&rcOldClip);
// Get the dimensions of the application's window.
rcClip = your_rectangle(400x400);
// Confine the cursor to the application's window.
ClipCursor(&rcClip);
//
// Process input from the confined cursor.
//
// Restore the cursor to its previous area.
ClipCursor(&rcOldClip);
|
|
|
|
|
THanks for the code. But I am still quite confused.
rcClip = your_rectangle(400x400);
When I use GetClientRect(), it retrieved the coordinates of the top left of the client. However, when I am using SDI, there is menu and toolbar.
Can you write more detailed? I am new to visual C++ but I have programming experience.
Thanks;)
|
|
|
|
|
POINT p;
GetClientRect(hwnd, &rcClip);
p.x = rcClip.left;
p.y = rcClip.top;
ClientToScreen(hwnd, &p);
OffsetRect(&rcClip, p.x, p.y);
ClipCursor(&rcClip);
ShowCursor(TRUE);
//////////////////////////////
// The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner will be (0,0).
// The ClientToScreen function replaces the client coordinates in the POINT structure with the screen coordinates. The screen coordinates are relative to the upper-left corner of the screen.
// The OffsetRect function moves the specified rectangle by the specified offsets.
// The ClipCursor function confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, Windows automatically adjusts the position to keep the cursor inside the rectangular area.
|
|
|
|
|
Hi!
I am looking for a control, where i can select the text width. For example in MS Excel if i want to import a textfile with a fixed width.
http://schueler.bulme.at/~vodep_mi/screen.png
(Sorry i only have office on mac)
Does anybody know how i can build such a control with the MFCs?
thx,
regards mike
|
|
|
|