|
Thanks for the help Brian.
I am really new to programming, and do not understand how to do what you are telling me.
How would I declare an instance of the "formatting" class inside the class with the "working" socket?
What other information do you need to know about my program?
Many thanks in advance.
|
|
|
|
|
You said you have a class that formats the string, yeah? ... Unless it is a static function within the class that you are using (i.e. you would be doing something like MyFormatClass::FormatString(string); .
Otherwise you have to do something like:
MyFormatClass mfc;
or
MyFormatClass* mfc = new MyFormatClass()
Are you doing anything like this???
If you want, email me on the code.
Regards,
Brian Dela
http://www.briandela.com[^]
|
|
|
|
|
Hi
I´m new to C++ and working with passing files back and fourth to a webservice. I have found som code in C# that does this for me but I can´t convert it into C++. Can someone please help me with the two last lines?
DimeAttachment attachment = new
DimeAttachment("application/octet-stream", TypeFormatEnum.MediaType, ms);
HttpSoapContext.ResponseContext.Attachments.Clear();
HttpSoapContext.ResponseContext.Attachments.Add(attachment);
Regards
// Daniel
|
|
|
|
|
Do u know a func. like scanf() which works in C's graphic mode? ( I can't position the cursor with gotoxy() command while using scanf() func in graphic mode.)
note:i am using Borland TURBO C++ v.3.0
|
|
|
|
|
sscanf
Don't try it, just do it!
|
|
|
|
|
I need to use the sqrt() function in <cmath> in one of my functions in a Windows program using MFC. At the top of the file I put in these lines:
#include <cmath> <br />
using std::sqrt;
and I got this error:
error C2653: 'std' : is not a class or namespace name
Why doesn't the compiler recognize the std namespace?
|
|
|
|
|
It's odd that it does not work. As a workaround, use the C-standart function.
<br />
#include <math.h><br />
...<br />
double x = sqrt (y);<br />
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Thanks, I did that.
I'm using VC++ 6.0 if that helps.
|
|
|
|
|
Try:
#include <cmath>
using namespace std;
...
// use the sqrt func
float x = sqrt(y);
or you can just call the sqrt function without the "using" keyword:
#include <cmath>
...
// use the sqrt func
float x = std::sqrt(y);
HTH.
David Hisel -- http://www.hisel.com/
|
|
|
|
|
I tried both of those, but as expected, I get the same error--my compiler does not recognize "std" as a namespace.
My compiler does recognize "std" as a namespace for win32 console apps, but not this, my first win32 with MFC app attempting to use the std namespace.
|
|
|
|
|
The things I will say in this reply are MS Visual C++ 6.0 specific. I have not tried them on any other compiler.
7stud wrote:
My compiler does recognize "std" as a namespace for win32 console apps
You probably use #include <iostream> , which includes the std namespace. But, the cmath header file does not contain the std namespace. In fact, the following code is perfectly legal:
#include <cmath>
int main() {
double x = sqrt(5);
}
But this one is not:
#include <cmath>
using std::sqrt;
So you don't need to use the std namespace if you are going to use cmath in Visual C++ 6.0.
Hope this helps.
Hosam Aly Mahmoud
|
|
|
|
|
Thanks for the explanation.
|
|
|
|
|
You're welcome.
Hosam Aly Mahmoud
|
|
|
|
|
How do you get the current time of the machine in milliseconds.
I have used the time() function from time.h before but that only gives me back up to the seconds..
Any ideas would be great - thank you
|
|
|
|
|
Try _ftime .
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
GetLocalTime
Don't try it, just do it!
|
|
|
|
|
I do not know of a time function that returns the milliseconds. If, however, you are looking for a stopwatch function, you may give CWnd::SetTimer / CWnd::KillTimer a look. However, be forwarned that even though it boasts triggering off of microseconds, it does not guarantee accuracy... quote from MSDN
"Because the accuracy of a timer depends on the system clock rate and how often the application retrieves messages from the message queue, the time-out value is only approximate."
I apologize if this suggestion isn't even remotely close to what your looking for.
|
|
|
|
|
Hi
I have this program which reads/write some things from/to registry, but i have no idea what it exactly reads/writes in the registry when it gets launched.
Is there any utility to monitor what a program exactly does when it gets launched, registry is only one of the things that can be monitored.
Anyone knows?
Greetings
Jens
|
|
|
|
|
RegMon[^] monitors the registry.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
thank you
i installed Turbo Demo4 here to make a demo for an application. I didn't buy for it, trial version but now i can only use it 30days and i didn't register so i lost all documents (can't open the program anymore .. not even when i reinstalled)
and don't seem to find any keys for the program as well eheh
|
|
|
|
|
|
I'm running Windows Server 2003 and I get an error message like "Access denied" when I try to run it. I'm logged in as Administrator.
Do you know what could be wrong?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Nope, sorry.
Cheers,
Fredrik
"Felix qui potuit rerum cognoscere causas."
|
|
|
|
|
now i have developed an application file that suffix is .exe.I want to use a window installer for it?how can i do?
thanks!!
Habbit--Beginner In MFC
|
|
|
|
|
If you want an excellent freeware installer I highly recommend Innosetup from:-
http://www.jrsoftware.org/isinfo.php[^]
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|