|
let say i want to transfer an object of CFile
how to transfer an object of it?
there is one way i know and that is tranfer the file bit by bit or using string transfer the file and again construct it on remote location.
BUT i want to tranfer the file object if it is possible writ the syntex of it ?plz?
r00d0034@yahoo.com
|
|
|
|
|
Yes,
if you simply have the code to handle the object on both machines, you can copy the data from the object to a flat stream of memory, then send that memory to the other machine and reconsitute the object.
If you do not have the code to run the object on the other machine, it is still possible to run the object on the other machine, but it is a lot of work, and opens up security holes.
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!
|
|
|
|
|
is it possible when my application is running no other application could recive any type of keboard message and mouse messages.
while my running application recive it ?
r00d0034@yahoo.com
|
|
|
|
|
yes, try message hooks
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!
|
|
|
|
|
is it possible to log off any system programatically?
if yes how in vc++ and how in csharp?
r00d0034@yahoo.com
|
|
|
|
|
BOOL bStatus = ::ExitWindowsEx (EWX_LOGOFF, 0);
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
please read that code and solve my problem.
Given after that code.
///////////////////////////////////////////////////////////
>>><<<
public class Win32Hook
{
[DllImport("kernel32")]
public static extern int GetCurrentThreadId();
[DllImport( "user32", CharSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall)]
public static extern int SetWindowsHookEx( HookType idHook,
HOOKPROC lpfn,
int hmod,
int dwThreadId
);
public enum HookType
{
WH_KEYBOARD = 2
}
public delegate int HOOKPROC(int nCode, int wParam, int lParam);
private HOOKPROC hookProc;
public void SetHook()
{
hookProc = new HOOKPROC(this.MyKeyboardProc);
SetWindowsHookEx(HookType.WH_KEYBOARD, hookProc, 0,
GetCurrentThreadId());
}
public int MyKeyboardProc(int nCode, int wParam, int lParam)
{
return 0;
}
}
To install the hook procedure
Win32Hook hook = new Win32Hook();
hook.SetHook();
///////////////////////////////////////////////////////////
Above code is 100% correct but my problem here is that I want to execute it for each thread for that purpose I modify a line of code and that is
SetWindowsHookEx (HookType.WH_KEYBOARD, hookProc, IntPtr.Zero,0 );
But after changing that line of code it does not solve my problem because MyKeyboardProc function does not execute its code.
I don’t know why? Can any body give its solution?
r00d0034@yahoo.com
|
|
|
|
|
Hi I would like my program to pull up a message box once a day on it's own. From what I understand I need to use a timer function. I would like it to give me a message box when the clock on my computer reaches 12pm everyday. Does anyone know a simple way of doing this? thanks Mavrock
|
|
|
|
|
Check out SetTimer() and WM_TIMER
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Basically, use liek this, with ON_WM_TIMER()
SetTimer(1, 3600 000, NULL);
3600 000 here indicates an hour... it's in msec.
so the code would look like.....
int iTimer = 0; //global variable to count time
//this will get invoked every hour
YourClass::OnTimer(UINT nIDEvent)
{
iTimer=iTimer+1;
if(iTimer == 12){
//do your processing....
}
if (iTimer == 24){
iTimer = 0;
}
}//end of fn
hope this helps dude.
jey
|
|
|
|
|
Thanks very much for the direction.
I don't suppose you have some small source files you could send me. I'm new to programming and I have a hard time putting the code in the right place. usually when I see the source files I can just duplicate what was done before and make it work.
Thank again. Mavrock
my email is stonematthies@hotmail.com
|
|
|
|
|
For this waitable timers are best, because (as opposite to WM_TIMER) they do not work only with relative time, but also with absolute time and therefore fire at the right moment even if the machine was down in the mean time, the clock was adjusted or something else.
Check out CreateWaitableTimer() for more info about waitable timers.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
I'm using MFC to write to a file, but it seems that it likes to overwrite the file. I thought the CFile::NoTruncate tag would do it, but I seem to be wrong. I'm using CArchive to do the file I/O.
Thanks for your time =)
|
|
|
|
|
Try:
<font color=blue>CFile</font>::Seek(0, <font color=blue>CFile</font>::end); <font color=green>//Places the file pointer at EOF. Proceed from there... :cool:</font>
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
This maybe too late but good for some old MFC folks like me:
If the file does not exist, create it using CStdioFile:
if (!pfile.Open(fileName,CFile::modeReadWrite))
{
pfile.Open(fileName,CFile::modeCreate|CFile::modeReadWrite);
}
pfile.SeekToEnd();
MFC forever!!!
henryh
|
|
|
|
|
Can anyone give me an idea of some ways to prevent Windows from running applications - all executables???
Thank you in advance...
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Which Windows, what EXEs, WTF do you mean man??!!
Details baby, details....
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I have wondered this myself and although I have never tried to implement anything I have considered the following as options.
1) Inject some machine code inside each exe calling PostQuitMessage(0)
2) Iterate the processes currently running using a timer and determine which should run or not.
3) You might be able to prevent users from running applications by clicking desktop icons, I think you would wanna read up on shell extensions for more info on how to do this...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I would look into replacing the windows loader. That way you can decide who gets loaded, from EXE to DLLs.
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!
Is there a way to open a VC7 workspaces with VC6? Is there a converter?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
There is no known VC++7 --> VC++6 project converter.
I am building a converter. It will be available next week (probably).
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
cool
I just found out that it is also possible to create a new VC6 workspace and add all source files from the VC7 project. It works
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Gregor S. wrote:
I just found out that it is also possible to create a new VC6 workspace and add all source files from the VC7 project
A VC project is not only a set of files, it's a full makefile. You won't be able that easy to target a given set of files to produce for instance a DLL with shared MFC.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I want the WebBrowser control to draw on my provided window (Static Control) instead of its own window. The actual thing I want to do is to make the WebBrowser invisible and display its contents on my Window.
I have tried exchanging window handles b/w WebBrowser and my Static control but it crashes program. This thing doesnt crash for exchange b/w two static controls and i get to draw what one static is drawing on other one by such exchange. But i want webbroser to draw on my window.
Isnt there anyway tht we override Device Context of WebBrowser.
Anythought are appreciated.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
The web browser is hosted by an ActiveX control site, like any ActiveX, which hides all the complexity of the underlying windows, hence dc and stuff like that. Very unlikely you get to do what you want.
You could ask for the web browser to print (draw to a print dc), while you have selected a fake virtual printer, which you actually control. IMHO, this requires a printer driver (.vxd or something like that), ... Lotsa work!
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|