|
please give a example.
appreciate any help!!
|
|
|
|
|
All services need a local system account in order to run, or have I missed the point?
Ant.
|
|
|
|
|
CreateService(
scm,
szInternName, //internal name
szDisplayName, //display name
m_dwDesiredAccess, //desired access def: SERVICE_ALL_ACCESS
m_dwServiceType, //service type def: SERVICE_WIN32_OWN_PROCESS
m_dwStartType, //start type def: SERVICE_AUTOSTART
m_dwErrorControl, //error control def: SERVICE_ERROR_NORMAL
szFullPath, // exec name and full path
m_szLoadOrderGroup, //load order group def: none
m_lpdwTagID, //group tag ID def: none
m_szDependencies, //dependencies def: none
".\\Administrator", // user account name def:Local System
"password"); // user account password
hope everything else same ...
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
I am having the same problem. If you have done it already, could you guide me ragarding this?
|
|
|
|
|
Hi,
In Visual Basic, when working with objects, we have the following syntax:
<br />
obj.property=value or variable=obj.property<br />
call obj.method([params])<br />
Remember that the property is not only member variable which is declared with public modifier but the property can (and in fact its always) be a function. So we do not need to know where to store value or where the data of variable come from inside the object. More over, function inside property allows us to do few calculations based on value set or got.
My question here is: In Visual C, Could I implement such programming style, by any way?
At present, I implement such style by declaration a member variable as public member, but it may not good when working with object. Implementation Set , Get functions do not allow VB programming style.
Thanks for reading.
|
|
|
|
|
Extracted from MSDN:
__declspec( property( get=get_func_name ) ) declarator<br />
__declspec( property( put=put_func_name ) ) declarator<br />
__declspec( property( get=get_func_name, put=put_func_name ) ) declarator
This attribute can be applied to non-static “virtual data members” in a class or structure definition. The compiler treats these “virtual data members” as data members by changing their references into function calls.
When the compiler sees a data member declared with this attribute on the right of a member-selection operator (“.” or “->“), it converts the operation to a get or put function, depending on whether such an expression is an l-value or an r-value. In more complicated contexts, such as “+=“, a rewrite is performed by doing both get and put.
This attribute can also be used in the declaration of an empty array in a class or structure definition. For example:
__declspec(property(get=GetX, put=PutX)) int x[];
The above statement indicates that x[] can be used with one or more array indices. In this case, i=p->x[a][b]
will be turned into i=p->GetX(a, b) , and p->x[a][b] = i will be turned into p->PutX(a, b, i);
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
Thank you very much.
Could you show me where to get that article in MSDN?
I am using MSDN October 2001. But I did not find your article in its. I think your idea is very interesting.
|
|
|
|
|
be careful, OOP is NOT available in C (so either in Visual C). object programming comes with C++.
And for your question, yes, you can.
Classes are made for such. You put your data members eito private or protected statements (in general) as properties, and the interface for your classe, defined with your function members ("methods" in VB) are in a public statement.
All of this is not definitive, but it is a cool way of programming properly.
TOXCCT >>> GEII power
|
|
|
|
|
I am trying to edit 2 C source files i downloaded... and re-convert the edited files into .exe's but i am having errors...
the error keeps stating:
"fatal error C1083: Cannot open include file: 'dir.h': No such file or directory"
i dont konw if dir.h is a header file that is missing and i need it before i can compile my source files.
is there any headers or other files that i must have in order to compile a source file into a .exe?
any help would be appreciated!
-Zac
"i bring a knife to a gun fight"
|
|
|
|
|
dir.h is not a VC++ header file. so for the building of your code i would suggest you to search the build environment for the code or if you want to build it on VC++ environment then remove the header and then compile the program. so you will see some compilation error like the particular function is not defined. try to get the subsitute of this function on VC++ library.
hope this will help you.
jitendra
|
|
|
|
|
I am using "straight C" (VC6.0) and want to change the background color of the edit-box part of a datetime control (this would be the part that is displayed in the dialog and contains the date that was selected via the drop-down calendar. I know you can change various parts of the calendar itself (by sending a MCM_SETCOLOR message with one of six parameters), but how can I change the color behind the date displayed in the 'edit' box part of the control? My dialog box background is a light yellow, and the (apparently default) background white color of the DTP control is distracting...
|
|
|
|
|
How do I set a tooltip on a tree control item?
I know I can call CTreeCtrl::SetToolTips() but that is for the control not each item in the tree control.
Can any one help me with this?
|
|
|
|
|
You'll have to add support yourself. There's a few examples on CP here[^] which will tell you how to do it.
"Oh, I'm sick of doing Japanese stuff! In jail we had to be in this dumb kabuki play about the 47 Ronin, and I wanted to be Oshi, but they made me Ori!"
|
|
|
|
|
I have a variable int that when I divide by 2, it all on it's own it divides by 4. By playing with it, I figured out that if I mulitply by about the square root of 2 / 2 the computer simply divides by two.
I've even rebuilt the whole project. The int is normally around 3,000,000 and the only thing I can think is that maybe it's larger than it may legally be.
So I tried casting it to double, but I got the same responce. Any and all help is greatly appreciated.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
This is mighty weird. What are the exact lines of code that are doing the division?
|
|
|
|
|
int iDecryptID = m_iID;
iDecryptID /= 2;
return iDecryptID;
By returning m_iID I know that it is, in fact, the divison that is the problem.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Nope, the division is working properly.
The chance of a compiler error is very very very small.
If the output isn't matching the expected value, then the input isn't what you think it is or something else is going on.
With strange problems like this, 99.9999% of the time it is the programmer who is making assumptions that are wrong.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Can you post more context? I'm quite sure that,
#include <iostream%gt;
int Bogus ( int nTest )
{
int iPart = nTest ;
iPart /= 2 ;
return iPart ;
}
int main ()
{
std::cout << "Result of Bogus ( 3000000 ) = " << Bogus ( 3000000 ) << std::endl ;
return 0 ;
}<pre>
will be as expected.
Paul
|
|
|
|
|
Hi all,
I need to abort a procedure upon the user hitting the <esc> key. Could anyone point me in the right direction on how to implement it? Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Well, if it's a console app (not sure for others... may or may not work) you can do something like the following:
if (kbhit())
{
if (getch() == 26)
{
// escape key was pressed!
}
}
And I believe you have to include conio.h. Also, I'm not positive 26 is the escape key... but my gut says it is. And if you are costantly looping through that code, you will know when the escape key was pressed.
Good luck.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
Escape is 27, from memory. However, it's bad to rely on these values, you should use the virtual key constants instead.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
You need to either run your procedure in a seperate thread or use GetAsyncKeyState. To check for escape, I reckon the constant is VK_ESC, but that's a guess. This function tells you if a key was pressed since it was last called, so call it, then do something like:
if (GetAsyncKeyState(VK_ESC))
{
// finish off and go home
}
Actually, the most significant bit is set if the key is down now, and the least significant MAY be set if it has been pressed, so MSDN tells me. The above is how I always did it, and I'd say it's more efficient than bit mashing over and over inside your process.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
VK_ESCAPE
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks for the input. Your suggestion worked just fine. Best,
Ralf.
|
|
|
|
|
Is there anyway to Intergrate MSDN 2003 Library into Visual C++ 6, when i press F1, it says there is no Help System MSDN Availiable, when i goto Options -> Help System Tab, it says MSDN 2003 isnt installed.,
Is there anyway to get MSDN 2003, to be avaiable for Visual C++ 6
|
|
|
|