|
Hi,
I have an executable being invoked from a VC++ code through ShellExecute. After the completing of this executable, I have got a list of jobs to be performed in a sequence.
But when I run this application, ShellExecute will create a different shell and execute the exe (which is as expected) and the list of jobs will also be executed before the completion of the execution of my exe.
eg.
ShellExecute(GetSafeHwnd(), "open", print.exe, params, NULL, SW_HIDE);
task1
task2
task3
I want print.exe to execute first and then go execute task1, task2, task3 in a sequence.
I want to know whether we have any synchronization method which can be invoked just before task1 so that the control will flow in a sequence.
print.exe is executed only thro' ShellExecute().
Either a system() call, WinExec() etc will not work.
Please help me out.
Thanks,
Prashant
|
|
|
|
|
Use ShellExecuteEx, set the flag member to SEE_MASK_NOCLOSEPROCESS to get the process handle and use WaitForSingleObject on that handle.
Jens
|
|
|
|
|
Thanks for the reply, that worked!!!
|
|
|
|
|
#include<iostream>
#include<complex>
using namespace std;
inline complex<double>&operator+=(complex<double>&cval,double dval)
{return cval==complex<double>(dval);
}
int main()
{
complex<double> cval(4.0,9.8);l
cval+=1;
cout<
|
|
|
|
|
main isn't returning a value; there is no return statement!
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
but compile will extend the inline that has the retun value
|
|
|
|
|
No it won't, except by chance of register values. If you want a function to return a value in C/C++, you have to use the keyword return .
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hey,
don't confuse an inline woth a macro. An inline functions stays a function. when the docs say the compiler will extend the inline, first, it is not an obligation (it does it only if the function is not very complicated), second, it does NOT copy the content of the function at the calling, it makes an adaptation.
the function :
<font style="color:blue;">inline int</font> my_sum_func(<font style="color:blue;">int </font>iParam1, <font style="color:blue;">int</font> iParam2) {
return (iParam1 + iParam2); <font style="color:green;">
}
the calling :
<font style="color:blue;">void</font> main (<font style="color:blue;">void</font>) {
<font style="color:blue;">int</font> iSumResult = my_sum_func(5, 3);
}
<font style="color:green;">
the compiler will extend such code like this :
<font style="color:blue;">void</font> main (<font style="color:blue;">void</font>) {
<font style="color:blue;">int</font> iSumResult = (5 + 3);
}
are you now convinced ?
!!! : Don't forget : the compiler extends inlines functions only if it can, that is not an obligation to it !
TOXCCT >>> GEII power
|
|
|
|
|
I have a application that inserts a CString and CList in a std::map;
In .h file
typedef CList<csplfiletsinfo*, csplfiletsinfo*=""> SplFileTSInfoList;
typedef std::map<cstring, splfiletsinfolist*=""> tagSplFileInfoMap;
tagSplFileInfoMap m_SplFileInfoMap;
In .cpp file
//A vrialble of type SplFileTSInfoList
SplFileTSInfoList *l_SplFileTSInfoList;
//Insert the Key and the List in to the Map
m_SplFileInfoMap.insert(f_crstrUserID,l_SplFileTSInfoList);
But when I compile this I get an error.
error C2664: 'std::_Tree<_Traits>::iterator std::_Tree<_Traits>::insert(std::_Tree<_Traits>::iterator,const std::_Tree<_Traits>::value_type &)' : cannot convert parameter 1 from 'CString' to 'std::_Tree<_Traits>::iterator'
with
[
_Traits=std::_Tmap_traits<cstring,clist<csplfiletsinfo *,csplfiletsinfo="" *=""> *,std::less<cstring>,std::allocator<std::pair<const cstring,clist<csplfiletsinfo="" *,csplfiletsinfo="" *=""> *>>,false>
]
and
[
_Traits=std::_Tmap_traits<cstring,clist<csplfiletsinfo *,csplfiletsinfo="" *=""> *,std::less<cstring>,std::allocator<std::pair<const cstring,clist<csplfiletsinfo="" *,csplfiletsinfo="" *=""> *>>,false>
]
|
|
|
|
|
Well, I guess you would like to map a string to a CList.
If yes, use this:
<br />
typedef CList SplFileTSInfoList;<br />
typedef std::map< CString, SplFileTSInfoList > tagSplFileInfoMap;<br />
<br />
...<br />
<br />
m_SplFileInfoMap.insert( tagSplFileInfoMap::value_type( f_crstrUserID, l_SplFileTSInfoList ) );<br />
<br />
Jens
|
|
|
|
|
Your error is because you aren't calling insert properly. I would guess (though it's hard to tell from your code) that you will want to try
<br />
m_SplFileInfoMap.insert(make_pair(f_crstrUserID, l_SplFileTSInfoList));<br />
--Dean
|
|
|
|
|
I have a application that inserts a CString and CList in a std::map;
In .h file
typedef CList<csplfiletsinfo*, csplfiletsinfo*=""> SplFileTSInfoList;
typedef std::map<cstring, splfiletsinfolist*=""> tagSplFileInfoMap;
tagSplFileInfoMap m_SplFileInfoMap;
In .cpp file
//A vrialble of type SplFileTSInfoList
SplFileTSInfoList *l_SplFileTSInfoList;
//Insert the Key and the List in to the Map
m_SplFileInfoMap.insert(f_crstrUserID,l_SplFileTSInfoList);
But when I compile this I get an error.
error C2664: 'std::_Tree<_Traits>::iterator std::_Tree<_Traits>::insert(std::_Tree<_Traits>::iterator,const std::_Tree<_Traits>::value_type &)' : cannot convert parameter 1 from 'CString' to 'std::_Tree<_Traits>::iterator'
with
[
_Traits=std::_Tmap_traits<cstring,clist<csplfiletsinfo *,csplfiletsinfo="" *=""> *,std::less<cstring>,std::allocator<std::pair<const cstring,clist<csplfiletsinfo="" *,csplfiletsinfo="" *=""> *>>,false>
]
and
[
_Traits=std::_Tmap_traits<cstring,clist<csplfiletsinfo *,csplfiletsinfo="" *=""> *,std::less<cstring>,std::allocator<std::pair<const cstring,clist<csplfiletsinfo="" *,csplfiletsinfo="" *=""> *>>,false>
]
|
|
|
|
|
ykutanoor wrote:
m_SplFileInfoMap.insert(f_crstrUserID,l_SplFileTSInfoList);
Try
m_SplFileInfoMap.insert(std::make_pair(f_crstrUserID,l_SplFileTSInfoList));
There are other idioms for inserting into maps, I suggest reading around a bit.
Paul
|
|
|
|
|
I have a application that inserts a CString and CList in a std::map;
In .h file
typedef CList<csplfiletsinfo*, csplfiletsinfo*=""> SplFileTSInfoList;
typedef std::map<cstring, splfiletsinfolist*=""> tagSplFileInfoMap;
In .cpp file
//A vrialble of type SplFileTSInfoList
SplFileTSInfoList *l_SplFileTSInfoList;
//Insert the Key and the List in to the Map
m_SplFileInfoMap.insert(f_crstrUserID,l_SplFileTSInfoList);
But when I compile this I get an error.
error C2664: 'std::_Tree<_Traits>::iterator std::_Tree<_Traits>::insert(std::_Tree<_Traits>::iterator,const std::_Tree<_Traits>::value_type &)' : cannot convert parameter 1 from 'CString' to 'std::_Tree<_Traits>::iterator'
with
[
_Traits=std::_Tmap_traits<cstring,clist<csplfiletsinfo *,csplfiletsinfo="" *=""> *,std::less<cstring>,std::allocator<std::pair<const cstring,clist<csplfiletsinfo="" *,csplfiletsinfo="" *=""> *>>,false>
]
and
[
_Traits=std::_Tmap_traits<cstring,clist<csplfiletsinfo *,csplfiletsinfo="" *=""> *,std::less<cstring>,std::allocator<std::pair<const cstring,clist<csplfiletsinfo="" *,csplfiletsinfo="" *=""> *>>,false>
]
|
|
|
|
|
I wrote a C++ program the I run on a NT machine that writes structures to a binary file. I then move the binary file to a Unxi machine and I can't read the files correctly.
I am swaping the bytes, is this all that I need to do?
Thanks for ANY help.
Jim
|
|
|
|
|
Check the byte alignment. It is possible that the data is not written to the offset that you expect.
Ant.
|
|
|
|
|
It really depends on the architechture of each of the machines -- they might both be Little Endian, Big Endian, or a combination of the two. That is to say, you might not need to swap the bytes at all -- doing so could be what's giving you trouble.
If at all possible, try using the ntohs() and ntohl() functions to ensure you get your data correctly on any architecture.
--Dean
|
|
|
|
|
|
Depending on the machine architecture, and that the sizes of similar data types are the same byte length, I have seen issues where machines are not "byte" swapped but are "word" swapped. In those cases, it was every set of two-bytes that needed to be swapped with the next set of two-bytes. This is different than big/little-endian swapping.
If you are writing floating point values into the file, check that the NT format and the UNIX format are the same. NT probably uses the IEEE floating point format and some non-PC UNIX machines (and some hardware items) use a DEC format. This means that the meaning of the bits within a 4-byte floating point word are different ... different size mantissa, exponent, placement of sign bit, etc. I have had to re-align floating point bits between machines.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Hi !
I'm implementing into my project a CToolBarCtrl control. When I call the Create function, it doesn't matter the CRect that I set up because it always draws it on the top or bottom of the window (depends on the property that you set up), but I need to draw it into a CRect like floating into the window.
Could you help me please ?? If you could paste a very little example... thank you !!
Thanks in advance.
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
|
Can anyone give me link or where i start
i need to create new audio file foemat like .wav,.dss
pls help me regarding this...
thanx
regards
rajesh
|
|
|
|
|
How can I use visual c++ to establish a ipc$ connection with a remote hos and copy file from the host or upload a file to the specified path of the host?Is there any detailed demostrations?thanks!
|
|
|
|
|
How to implemet MAPIGUID ?example
dadsadasd
|
|
|
|
|
Other than mapiguid.h, I do not know what MAPIGUID is. Can you explain a bit further?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|