|
hi all,
any one can know how to stop the System Time.
thanks in advance.
|
|
|
|
|
I don't know if you can stop it, but you could get the current time, and then continually reset it back to that time
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Yes, you can: shutdown your machine, unplug it, open it, remove battery from motherboard - and magic, time is stopped.
|
|
|
|
|
hi all,
any can know how to stop the System Time.
thanks in advance.
|
|
|
|
|
Hi!
I've programmed in c/c++ in text mode for several years
and quite familiar with this great language.
Now want to program in Windows environment,but just don't see where to start. There is SO MUCH in it(plus this new .NET technology). Please help me,give me some guide or little hint where to start,what to read(on the WEB if possible).Should I start directly with c# instead?
Thankyou,
Vitaliy
|
|
|
|
|
All in all, if you do not have any experience in
Windows programming, its best that you should
start with c#.
Probably many people would not agree with me
but i think programming .Net in c# is the
fastest way to program for windows and
certainely .Net.
There is going to be ample market for .Net programmers
in c# and certainely VC++ is not going to go away
but c# will be used for a lot of UI programming.
There are a lot of books out there and also a lot of
articles on the web.
Best of luck on your .Net journey!!;)
|
|
|
|
|
I disagree with the other guy. There is no reason to throw away your C++ skills to learn a lesser language, just because it is flavour of the month. MFC is pretty easy anyhow, just get a book and ask questions.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
I always argued that it's best to learn Win32 API first (at least basic concepts) and then move to MFC.
Regards,
Venet.
--------
Black holes are where God divided by zero.(Steven Wright)
|
|
|
|
|
|
Thanks for replies.
I understand that .NET is the way people will program Windows UI in the feature. I don't have any experience with c#,but heard it is very similar to Java.
I think Managed C++ is the most logical solution,to take advantages of both c++ and .NET
All these are good,but could you link me to some useful resource on all of these to start? The resources on this site are narrowed to very specific parts of MFC/ATL/.NET... etc
|
|
|
|
|
I personally found that messing around with a few example applications from here at the Code Project (from various authors) was the best way to pick things up, really. Like you, I was doing mostly console-type apps and tons kernel mode dev., leaving my MFC and UI coding skills a little thin (actually, they were non-existent!).
Also, if you use the built-in Wizard to create an MFC app, you can get it to create a simple app for you right off the get-go that even compiles - start mucking around with the created project - I recommend starting out with a bare-bones Dialog app persobally, CDialog is a lot quicker to pick up and learn how to plop down controls and muck around with them.
Have fun with the learning, I've been messing with MFC now since Aug 2001 and have personally found that the examples here are fantastic learning tools for people who learn by example.
: Dean 'Karnatos' Michaud
|
|
|
|
|
Thank you,That is exactly what I need
Vitaliy
|
|
|
|
|
SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, true, NULL, SPIF_UPDATEINIFILE | SPIF_SENDCHANG)
Above is my code.
It works in WinMe, Win2000 and WinXP
but does not work in Win98.
Is anyone can give me any suggestion?
Thanks a lot.
|
|
|
|
|
Hello,
I'm trying to use GetModuleBaseName and EnumProcessModules, but I'm doing something wrong because I get linker error 2001. I guess that the problem is with WINAPI.
I have a .c file that is forced to be compiled as c++ and I call those functions from there like this:
EnumProcessModules(hProc, &hMod, sizeof(hMod), &cbNeeded);
GetModuleBaseName(hProc, hMod, pParentName, sizeof(pParentName));
Then I'm using PSAPI.h where I have
-- clip --
#ifdef __cplusplus
extern "C" {
#endif
-- clip --
BOOL
WINAPI
EnumProcesses(
DWORD * lpidProcess,
DWORD cb,
DWORD * cbNeeded
);
-- clip --
DWORD
WINAPI
GetModuleBaseNameA(
HANDLE hProcess,
HMODULE hModule,
LPSTR lpBaseName,
DWORD nSize
);
DWORD
WINAPI
GetModuleBaseNameW(
HANDLE hProcess,
HMODULE hModule,
LPWSTR lpBaseName,
DWORD nSize
);
#ifdef UNICODE
#define GetModuleBaseName GetModuleBaseNameW
#else
#define GetModuleBaseName GetModuleBaseNameA
#endif // !UNICODE
-- clip --
#ifdef __cplusplus
}
#endif
-- clip --
Now I get:
myprogram.obj : error LNK2001: unresolved external symbol _GetModuleBaseNameA@16
myprogram.obj : error LNK2001: unresolved external symbol _EnumProcessModules@16
Why?
I've read many examples and it seems to me that I'm doing this in the same way as they do.
I would be glad if someone helped me with this.
-Janetta
|
|
|
|
|
Ok, it is a linker error !
Come on, its the most common of the
linker errors !.
You forgot to include the psapi.lib
in your linker tab.
|
|
|
|
|
It is very common, but there are many reasons why you get it. Maybe this mistake was trivial, but it was new to me. Thank you anyway
-Janetta
|
|
|
|
|
Hi all,
I'm working with a database application in which the data base is located in a remote machine(Machine 1).The application which makes use of that data base is running on a remote machine(Machine 2).Both computers are running under Windows 2000 and are connected in LAN.I would like to clear my database(The database located in machine 1) once in a month by running an exe in that machine.How can i invoke another executable program(program for backing up the data base) which is located in machine 2 when the data base clearing program in machine 1 is just started.Can any one help me?.
With regards.
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
There is no existing infrastructure in place currently
to invoke a program at the remote machine.
Wait there is one way, Use the Task Schedular API.
But make sure that the remote exe is scheduled to
a future time and that it does not have a UI.
Or you could always use a Service and keep
listening on a specified port.
|
|
|
|
|
Most database applications have ablility to schedule tasks and jobs, so why write an application to do it?
|
|
|
|
|
use the Sheduletask API
or write a service
Renjith-CPian.
|
|
|
|
|
Ok, this is a revisit to the problem that Chris Losinger tried to help me with. I had wrongly thought GetFileSize was the problem, he helped me determine that was not the case, thanks again Chris!!
I have an app associated with a certain file type. When I double click the file, it opens up my app. In this way the file name is passed to the app. This works fine and I have proved it by popping a message box with the filename on it. As you can see below m_EncryptedFilePath is the file name in question.
HANDLE hOriginal = ::CreateFile(m_EncryptedFilePath,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
Now, in DEBUG mode, all is dandy. hOriginal is not NULL . But in RELEASE mode, it is NULL even though the correct file name is passed through in each case.
Could it be file permissions?? Access rights?? The way I'm associating the file with the app??
By the way, release mode works fine if I hard code the file name like so
HANDLE hOriginal = ::CreateFile("c:\\myfile.abc",
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
So I'm completely at my wits end over this at the moment. Any and all comments will be appreciated.
Senwe
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
What does GetLastError() return?
|
|
|
|
|
Good question, in DEBUG mode it returns 0, implying all is well. That's why when I'm debugging everything works. The release version of CreateFile returns a NULL handle.
Perhaps I should place a FormatMessage and populate a MessageBox to retrieve GetLastError in my release mode?
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|
If you think, that to populate a MessageBox is the right answer, you have to do it. (If you know what I mean)
I also have these type of problems and I have to fix them. The first step is to get a "handle" to the problem.
You have there a member variable for the file name. I guess it is a CString -> (LPCSTR) cast is best practise.
Try also Release Output of it to check its ok. ( I Do a Findfile to check this).
|
|
|
|
|
KarstenK wrote:
The first step is to get a "handle" to the problem.
Yep and my assumption was correct, the file isn't being recognised. GetLastError confirms this.
KarstenK wrote:
I guess it is a CString -> (LPCSTR) cast is best practise
Well yes, a WTL CString, not an MFC CString
And when God, who created the entire universe with all of its glories, decides to deliver a message to humanity, He WILL NOT use, as His messenger, a person on cable TV with a bad hairstyle.
|
|
|
|
|