|
ok i added those libraries ... also i added "stdafx.h" but got this error when compiling...
--------------------Configuration: netsent - Win32 Debug--------------------
Compiling...
netsent.cpp
c:\documents and settings\carter\my documents\c++ files\netsent.cpp(1) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
Error executing cl.exe.
netsent.exe - 1 error(s), 0 warning(s)
here is my source..
#include "stdafx.h"
#include <windows.h>
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
int main()
{
char user[20], message[1000];
char szFullMessage[256] = {0};
cout << "User/IP = ";
cin >> user;
cout << "Message = ";
cin >> message;
sprintf(szFullMessage, "net send %s %s", user, message );
system(szFullMessage);
return 0;
}
|
|
|
|
|
do anyone know the how to write code for rotating & mirror objects drawn in mfc? instead of drawing them again and again for each rotation.
e.x.
OnDraw()
{
//shape 1
draw the shape 1
//shape2
draw shape 2
//shape3
draw shape3
}
rotate()
{
//rotate shape 1, 45o degrees
//again rotate shape 1
//again rotate shape 1 etc...
}
Is there a code that do this rotating?(example-CRect, which draw the rectangle) something similar to this..
even if not just let me know...
thanks
shanila
|
|
|
|
|
How to add bar containing icons for commonly-used folders, such as My Computer, Favorites and Desktop in my CFileDialog?
|
|
|
|
|
hi
I don't know how to set icons in CFileDialog.But you can do this using Microsoft Common Dialog controls.
1. Go to Project-->Add to Project-->Components and Control.
2. Choose Registered Activex Controls and select Microsoft Common Dialog Control Version 6.0.
3. Insert this component.(The control will now appear in your tool box.)
4. Place the control in your dialog.
5. Add a member variable for this control.
6. Call the ShowOpen() method.
I hope it's OK for you
Mahesh Varma
|
|
|
|
|
|
hi, i'm looking for a routine to convert double to string with at least a precision as the windows calculator does(32 digits after the comma)!
does someone know such a function??
thx 4 help,
IceMatrix
|
|
|
|
|
try this:
double dFoo = 41.1325934653849974801841984193481498319048193849
char string[256];
sprintf("%d.32", dFoo);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
small correction of last line
<br />
sprintf(string,"%f", dFoo);<br />
|
|
|
|
|
|
Anna-Jayne Metcalfe wrote:
If you need more than that, you're going to have to roll your own.
I didn't think you smoked
The tigress is here
|
|
|
|
|
Only in the event of fire, fudge or extreme drunkeness.
Anna
Homepage | My life in tears
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
|
|
|
|
|
but how does the windows calc do it?
IceMatrix
|
|
|
|
|
It probably uses a custom datatype or a third party library containing one.
Do a search on the web and you should find something suited to your needs. It may not, however, be free.
Anna
Homepage | My life in tears
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
|
|
|
|
|
float f;
double d;
f = 3.1415926535897932384626433832795f;
d = 3.1415926535897932384626433832795;
printf( "%.32f\n", f );
printf( "%.32lf\n", d );
Output:
3.14159274101257320000000000000000
3.14159265358979310000000000000000
double has to be more precise, but the function doesnt show it!
|
|
|
|
|
I am looking for a way to get Windows to notify my application when a new USB device is attached or detached from the system.
The ideal solution would be a callback method of some kind, but a small low overhead polling loop could also work.
Thank you.
|
|
|
|
|
Windows sends a (rather, a few) WM_DEVICECHANGE message to all top level windows when *anything* in the device list changes.
You can also register for notifications for a specific device class, usign RegisterDeviceNotification()
Note: There's a bug in Win98 that makes UnregisterDeviceNotification crash.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Can this be done? I tried it and got assertion errors.
-- Steve
|
|
|
|
|
Maybe this will help you
http://www.codeproject.com/dialog/CDialogEx.asp
sledge
|
|
|
|
|
Hi,
I have a doubt. Please help me.
Myprogram.exe opens a text file in network with CFile::modeReadWrite | CFile::shareDenyWrite flag. Another instance of Myprogram.exe from another computer try to open the same file with CFile::modeReadWrite | CFile::shareDenyWrite flag at the same time. I would like to give the second Instance only read permission and show him the network ID of the person who has opened this file for writing.
How will I achieve it?
Thanking You
Kindi
|
|
|
|
|
Well, the first thing is easy. Just try to open the file with write access and if it fails, try open it again using only the read parameter (Use CFile::Open, not the constructor). The second thing with the network ID is a bit harder and depends on your file server.
Isn't it CVS what you want?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi,
Thank you for the reply.But how would I get the network ID..Could you please tell some steps to achieve this.
How will get a valid handle of the open file..how will I get the SECURITY_DESCRIPTOR pointer and computer name..or Is there some other way to do this?
Thanking You
Kindi
|
|
|
|
|
If you are only using NT-based systems, then SECURITY_DESCRIPTOR is the right way to do it. Just keep in mind that non-NT-based systems won't work with the security API.
To open a file and get a security descriptor for it, use the Windows API function CreateFile . As far as I know the MFC class CFile doesn't support security descriptors. It sounds like it would create a file, but it also opens files normally. Read MSDN for more.
This security descriptor also contains a structure which identifies the current owner (i.e. the one who has opened the file with write permission currently).
I am sorry that I cannot provide you a short source code snippet, I never used the security descriptor APIs.
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi
Thank you once agian..
GetSecurityInfo() fn gives a pointer to the owner SID which needs a valid handle of open file.
LookupAccountSid() returns the account name but needs system name and a pointer to the owner SID(can be obtained from GetSecurityInfo()) .
So what we need really is system name of the process which opened the file and a valid handle of the open file
CreateFile() returns INVALID_HANDLE_VALUE for an open file whose write permission is denied.
What we have is only a file name..I don't know how to get those two parameters
Do you have more suggestions like using a mutex or opening a socket??
Thanking You
Kindi
|
|
|
|
|
Hi,
I'm using C++ in VS.NET. I've created an dialogbased MFC application.
How can I display a jpeg-picture in a dialog (MFC)? I wan't to load the picture from a file stored on my HD or/and from a char* pointing at the picture data.
Can I use the Picture Control or something easy like that?
|
|
|
|
|
Good news and bad news:
the picture control is for bitmaps only. Sorry. However, you could find a custom control that displays JPEGS and attach it to a CStatic object in your dialog. I couldn't tell you where this control could be found, but i'm sure it's out there somewhere.
-- Steve
|
|
|
|