|
It compiles fine for me, are you sure it's not some other thing that is causing the trouble? Maybe post some of the code surrounding this snippet.
cheers,
-B
|
|
|
|
|
For extracting the essence out of these weired error-messages, you can try using STLError Decryptor[^]
For me, it works fine - and it is free
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
You must make sure you have an #include <string> in your source file. Frequently you'll get things to compile with the declarations looking fine, but when usages start if the actual include isn't there then the compiler doesn't know what to do. I think this is being caused by the underlying compiler mechanics of how it instantiates templates.
|
|
|
|
|
Hello all,
How can i send a fax(by dialing a phone number and then sending the fax) by VC++ ?
Please introduce to me some documents and source codes
Regards,
Hadi Rezaee
|
|
|
|
|
TAPI will handle the dialing of the phone number. Sending the FAX is much harder because the protocol isn't supported natively in Windows.
If you are using Win2k have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxabout_3wv9.asp[^]
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Hello dear Michael
Thanks for reply, the document was useful too
hmm, I'll talk with my boss about it ...
In fact the current version that i'm working on it has named Special Version and actualy it has special users, not public version, and i think we should limit the user (WinXP is good choose !!!)
The last Microsoft Fax Service is supported by WinXP and WinDotNet2003
Best Regards,
Hadi
|
|
|
|
|
Hi,
I'd like to know how to kill a known process without knowing its process id. For example, if I have a process listed in the taskmanager process list as "bad_process", can I use the string "bad_process" as input to some function in order to get a handle on that process to kill it?
Any help would be appreciated.
Many thanks in advance.
Sincerely,
Jonathan.
|
|
|
|
|
There is a Kill.exe util that comes with some resource kits that takes a process name, internally looks up the process id and then calls terminate process using that id. MSDN has the sample project that builds this tool and shows you how to look up the process id based on title. You can get the sample here[^].
|
|
|
|
|
Many thanks Erik! That is all I need for my purposes.
Cheers,
Jonathan.
|
|
|
|
|
I´d like to save an array in a file. How could I save it in VC++?? And how could I retrieve it??
Thanks,
d.f
|
|
|
|
|
It is up to you which format you choose to store the data of the array. A simple possibility would be:
lengthCRLF
data<sub>1</sub>CRLF
..
data<sub>n</sub>CRLF (CRLF means new line) that is, one piece of data per line, beginning with the length of the array. Reconstructing the array from this info should be straightforward.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Is there a way to create a menu for a dialog box? Thanks.
bob
|
|
|
|
|
Sure, create your menu with the resource editor, then go to the dialog resource, open its properties popup and select the menu in the Menu combobox.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Does anyone know if there are issues using this function within a dll call? I am trying to use it to wait for a global mutex handle, and it seems to never recognize that the mutex is available. If I use WaitForSingleObject(), it works fine. There are reasons for wanting to use the MsgWaitForMultipleObjects() so I cannot just shrug it off, and go with WaitForSingleObject().
Any ideas?
HANDLE ghAcess;
From within some function:
<br />
if (ghAccess == NULL)<br />
ghAccess = OpenMutex(MUTEX_ALL_ACCESS,FALSE,"AccessMutex");<br />
<br />
DWORD dwWaitResult = MsgWaitForMultipleObjects(1,&ghAccess,TRUE,100,QS_ALLINPUT);<br />
switch (dwWaitResult) {<br />
case WAIT_OBJECT_0:<br />
case WAIT_ABANDONED_0:<br />
return(ghAccess);<br />
default:<br />
break;<br />
}<br />
|
|
|
|
|
Are you sure you are using MsgWaitForMultipleObjects the right way? With bWaitAll set to TRUE , the function only returns WAIT_OBJECT_0 is there is some input in the queue. Is this what you want?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
What I am looking for is a way to wait for the mutex (ghAccess) to become available while allowing messages to be processed.
|
|
|
|
|
Hi,
I keep getting a syntax error "C2059: syntax error : 'constant'"
When I try and specify a capacity for a vector based type.
<br />
...<br />
typedef std::vector<myClass> MyClassVector;<br />
...<br />
MyClassVector mcv (100);
<br />
I just stare and stare yet I cannot see the syntax error?
Thanks!
|
|
|
|
|
Which compiler are you using? The following compiles fine in VC++ 6.0sp5:
#include <vector>
class myClass{};
typedef std::vector<myClass> MyClassVector;
MyClassVector mcv (100);
int main()
{
return 0;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I keep getting a syntax error "C2059: syntax error : 'constant'"
When I try and specify a capacity for a vector based type.
<br />
...<br />
typedef std::vector<myClass> MyClassVector;<br />
...<br />
MyClassVector mcv (100);
<br />
I just stare and stare yet I cannot see the syntax error?
Thanks!
|
|
|
|
|
This is from MSDN Library:
If the error message occurs on a symbol immediately following a typedef'd variable, ensure that the variable has been defined somewhere in the source code.
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
That does seem to apply to my situation as if I don't specify
a capacity i get no syntax error.
<br />
...<br />
typedef std::vector<myClass> myClassVector;<br />
...<br />
myClassVector mcv;
|
|
|
|
|
have you tried
mcv.reserve(100);
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
I have a DLL class that I am exporting,
// Observer Class
class APA_API CStateObserver
{
...
}
class APA_API CStateMachine
{
public:
void PushObserver(CStateObserver * inpObserver);
private:
std::deque<cstateobserver*> m_dqObservers;
}
APA_API is the define that resolves to the correct __dellspec(lalalalalal) etc...
I get this compiler warning message,
warning C4251: 'm_dqObservers' : class 'std::deque<class cstateobserver="" *,class="" std::allocator<class="" *=""> >' needs to have dll-interface to be used by clients of class 'CStateMac
I have 'Warnings as Errors' set so this warning is a real problem.
What are my options?
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Did you include the header for the deque container?
Kuphryn
|
|
|
|