|
List is invalid
- Michael Haephrati מיכאל האפרתי
|
|
|
|
|
i want to write a windows service.
i tried to tried one. there is 2 .cpp file and 1 .h file. the exe is created but there is runtime error. actually i opened a WIN32 Application project and then added the files to the project and then created the executable.
what is the correct way to create a windows service app.
please send some links?
|
|
|
|
|
Hi,
Why dont you use the App Wizard to create a new ATL COM AppWizard and from the list select Service(EXE). The AppWizard handles all the interface with the Service Control Manager. All that you need to do is add code in the Run() function.
Hope this helps you.
Regards,
Mahadevan.
|
|
|
|
|
HI,
Wt is the difference between Static link library and Dynamic link library.
and how can we create them.
thanx
Regards.
|
|
|
|
|
Hi,
Static libraries are included at compile time, and dynamic libraries are loaded at run time. Dynamic libraries are the .dll files you see around windows directories.
To create the libraries in VC6 use the AppWizard. Static libraries are the easiest to use, just create a dependancy on the workspace that needs to use the library. The workspace will take care of including the library code, etc.
Dynamic libraries are a bit harder to use, but once you have used them for a while they become easier. You can either create MFC dll's or Win32 dll's. Creating them through the AppWizard will give some eg code on how to use them.
I hope this helps
cheers,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
# 1
Static libraries are linked at compile time. Dynamic
libraries are linked at runtime
# 2
static library is faster than dynamic library
# 3
above answer is correct and..
the excutable exe size will be larger when we build exe
with static library compared to dynamic library
# 4
Above answers are correct. In case of Dynamic Library your
executable will look up for the code at run time. E.g. when
running some exe it looks for help from some .dll files
provided by windows operating system. So we call this
dynamic linking.
# 5
The static linked library causes the corresponding information from libraries to be included in the executable DLL on the other hand inserts virtual address of memory. Thus the size of static linked file is larger than a static linked file. If we use dynamic linking the updates in library will also be effect the behavior of the file while not in static linking. Due to this reason dll is better but it can also sometimes make the program faulty due to library update.
|
|
|
|
|
Suppose i have a string like
CString csPath = "c:\\windows\\test.exe -parm1"
or
CString csPath = "c:\\windows\\test.exe /parm1"
now to test whether test.exe exists or not
i can't just use csPath and call GetFileAttributes that will fail because of the commandline arguments
i will have to extract the application path from the full command line which will be tedious(the examples above are easy but there are more complex ones like:
C:\WINDOWS\ISUNINST.EXE -f"C:\Program Files\Adobe\Photoshop 5.5\Uninst.isu" -c"C:\Program Files\Adobe\Photoshop 5.5\Uninst.dll" )
any help suggestions are welcome
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
http://www.mastishk.com
|
|
|
|
|
PathRemoveArgs() should help
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Why not use:
TCHAR szDrive[_MAX_DRIVE];
TCHAR szDir[_MAX_DIR];
TCHAR szFname[_MAX_FNAME];
TCHAR szExt[_MAX_EXT];
::_tsplitpath(csPath, szDrive, szDir, szFname, szExt);
Then, just check to see if you have the filename and extension in szFname and szExt.
|
|
|
|
|
if i want to access value of the textboxes in previous dialog (for both modal and modeless) into the new dialog
veda
|
|
|
|
|
use SendMessage with ur parameters as wparam/lparam.
rgds..mil10.
|
|
|
|
|
thanks first,,
what mean CFileException::accessDenied (m_cause is 5 ) ?
msdn just says "The file could not be accessed."
|
|
|
|
|
That's what it means. It means the file is not there, or you can't do what you were trying to do to it ( for example, open a file for writing if it's on a CD, or is read only )
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Is it possible to inspect or print out either the typeid of a pointer to a c++ class, or the actual value typecast e.g. if I have 'class parent {}' and 'class child : public parent {}', and in the routine I want to debug I have a 'parent*' that I'm pretty sure is actually of type 'child', is there a way I can bring that up? I've tried the command window, in both command mode and immediate mode, but I can't figure out the right syntax to use.
|
|
|
|
|
Looks like the RTTI to me.
To print out, check codes below (from MSDN)
Makesure, you have your project RTTI enabled.
// expre_typeid_Operator.cpp
// compile with: /GR /EHsc
#include <iostream>
#include <typeinfo.h>
class Base {
public:
virtual void vvfunc() {}
};
class Derived : public Base {};
using namespace std;
int main()
{
Derived* pd = new Derived;
Base* pb = pd;
cout << typeid( pb ).name() << endl; //prints "class Base *"
cout << typeid( *pb ).name() << endl; //prints "class Derived"
cout << typeid( pd ).name() << endl; //prints "class Derived *"
cout << typeid( *pd ).name() << endl; //prints "class Derived"
delete pd;
}
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
In my multithreaded dialog-based app, I'm popping up two modal dialogs at the same time (in seperate ON_FOO_MSG handlers). When one closes, I'd like focus to return to the other, but right now it returns to the main dialog instead. Calling SetActiveWindow() or SetFocus() or SetForegroundWindow() on the remaining dialog brings it to the foreground, but the dialog still won't accept any keyboard input (somehow, ESC still closes it, though).
-KB
|
|
|
|
|
This is not a good design. Only one thread should be controlling the user interface.
In MFC, only one window can be inside a modal loop at any time. As soon as the dialog closes, modality returns to the dialog that was previously modal. There's nothing you can do about it without closing your main dialog. If you want to go from one to the other, you'll have to show the first one (and not the second one), and then show the second one when the first one closes.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I know it's not good design, but it's legacy code that I've got to work with.
Lets say that dialog A spawns dialog B and dialog C. If dialog C closes, keyboard commands seem to route back to dialog A (C's parent). Is there a way to route them to B instead?
|
|
|
|
|
kbratvold wrote:
Is there a way to route them to B instead?
Not that I know of.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I have a problem with MFC, I am building this application, and I am using the MFC wizzard to add message handlers for my menus, everytime I give a particular menu a name, say, SERVER now I add to the first empty item in the SERVER menu item called
ID_SERVER_MOUNT_SERVER
followed by
ID_SERVER_DISMOUNT_SERVER,
for some reason the the wizzard is assigning them both the same ID causing problems when I come to add the message handlers. If I go back and correct the problem, and re-compile, it still will not fix the problem, which apart for causing me to loose my hair, won't work when it comes to using
COMMAND and UPDATE_COMMAND_UI
Short from starting the whole project over, I don't have a clue why this problem exist, and solutions??
|
|
|
|
|
Best bet - learn not to use the wizards. They always screw things up.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi,
These header files are 'included ' (along with several others) in a C++ program i received. however, they are not on my system, and when i start the compiler, it cannot find them:
#include sys/time.h
#include termios.h
#include unistd.h
Are these standard files? Where can I find them?
Thanks
Michael
oops!
|
|
|
|
|
MichaelGG wrote:
Are these standard files?
On a UNIX system they are
MichaelGG wrote:
Where can I find them?
On a UNIX system, but the chances are the application won't work under Windows if it relies on anything in them.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
As the other guy said, they are standard for Unix.
You have two choices under windows: the better one is to figure out what parts of those are used, and then design a windows alternative. If this is open source and you do this, please submit the changes back.
The easier one (and perhaps just as good) is to install either Cygwin or mingw and use them to compile it, as they already have both most of what you need. You may still need to do some porting to make the programs work it won't be nearly as much work. I have no comments on which is better.
|
|
|
|
|
how can i access the parallel port input and output
|
|
|
|