|
SHELLEXECUTEINFO structure contains a member variable hProcess contains a handle to the new started process, but you mast set fmask to SEE_MASK_NOCLOSEPROCESS. and it will be NULL if no process launched.
Hope this help you.
Programmer/ Eid Mahmoud Taha
|
|
|
|
|
|
pri_skit wrote: Actually i am using ShellExecuteEx function...
Can you use ShellExecuteEx() instead?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello Everyone,
I am doing some looking-up of DNS information with the DnsQuery API function. I can recieve A, MX & SOA Fields perfectly from any given hostname.
When I call DnsQuery_A with a wType of DNS_TYPE_LOC, the call succeeds, but I have no way to get the information I need since the Data union in the DNS_RECORD structure returned by the call has no DNS_LOC_DATA structure defined. I have tried casting the union to a DNS_LOC_DATA but I get invalid data.
Could somone point me in the right direction, I have been searching around for most of the day and I can't find any examples of the DNS_LOC_DATA struct in use, and MSDN also doesn't provide any information that is of use.
Thanks For Any Help!
Robert Heffernan
Albury, NSW
My Code Requesting A Field Data
<br />
dsRet = DnsQuery_A(ndDns->cHostname, DNS_TYPE_A, DNS_QUERY_STANDARD, NULL, &drRecords, NULL);<br />
<br />
if(dsRet != NOERROR)<br />
return FALSE;<br />
<br />
My Code Requesting LOC Field Data
<br />
dsRet = DnsQuery_A(ndDns->cHostname, DNS_TYPE_LOC, DNS_QUERY_STANDARD, NULL, &drRecords, NULL);<br />
<br />
if(dsRet != NOERROR)<br />
return FALSE;<br />
<br />
dlLoc = (DNS_LOC_DATA *)&drRecords->Data;
|
|
|
|
|
hi,
I have got an IMDB(In Memory Database) file, and i want to read that data from that file and copy that into database SQL or file using c++. any help?
If this is not the correct forum to ask this question, then i am extremely sorry for that.
Warm Regards,
Mushq
|
|
|
|
|
You question is way too big to answer in a sentence or two. Break your problem up into several smaller ones. Which part are you needing help with?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In my Dialog (C++) application I kept getting an exception with the following code, define a strucure and creat a memebr variable of Type as per that stucture.
typedef struct <br />
{<br />
CString Name;<br />
CString rxChannel;<br />
CString txChannel;<br />
bool rxChannelDefined;<br />
bool txChannelDefined;<br />
}ACONFIGDATA;
But I got an exception (Bad Prt) when I did:-
m_As[Index].txChannel = chanData;
chanData is a CString.
However if I define the structure as follows:-
typedef struct <br />
{<br />
char Name[40];<br />
char rxChannel[3];<br />
char txChannel[3];<br />
bool rxChannelDefined;<br />
bool txChannelDefined;<br />
}ACONFIGDATA;
And use the following statement, all is fine.
strcpy_s(m_As[Index].txChannel, chanData);
I just want to understand how the exception was caused, please.
|
|
|
|
|
Can you show how you have declared m_As and using it ? Something other than metnioned code might cause problem ?
|
|
|
|
|
Declared as
ACONFIGDATA m_As[256];
But when inspected (via breakpoint) all the CStrings were Bad Prts
|
|
|
|
|
Code seems to be harmless, unless, you are accessing invalid index(out of bounds).
|
|
|
|
|
The index was in range so not that prblem.
|
|
|
|
|
May be you can mail across code. Cant figure out your problem from given info.
|
|
|
|
|
Which object threw the exception - the m_As object or the chanData string variable?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When ever I tried to set any of the CString fields;
e.g. m_As[2].txChannel= "13";
The bool fields were OK, just the CString fields; all Bad Pointers!
|
|
|
|
|
If you're using VS2005, try changing your project's properties to use the multi-byte character set.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
hi,
i add a section for my exe file. in my section, i need to create a thread.
because my code in this section is with assembly language in asm block then, i call address of CreateThread api function to create my thtead, and before call, i push necessary parameters. i push address of myThreadFunc lable.
my exe is executed and my tread is created but "don't send" error appears.
is an example or article for my problem?
Zo.Naderi-Iran
|
|
|
|
|
Would this help?
http://win32assembly.online.fr/tut15.html
|
|
|
|
|
thank you , this article was useful for me.
i call PostMessage api function end of myThreadFun.
Zo.Naderi-Iran
|
|
|
|
|
you are welcome
btw, if you didnt check the page; http://win32assembly.online.fr
Iczelion page is great...
|
|
|
|
|
In a vector are stored class pointers;
<br />
class sample1 : public mybase<br />
{<br />
}<br />
<br />
vector<sample1*> vec;<br />
I would like to cast it;
<br />
vector<mybase*> *result = (vector<mybase*>*)&vec;<br />
I got a response previously that it is not possible, but i dont understand why.
Actually i am not sure this is a problem for my core dump.
I have been thinking about; if i have pointer stored inside vector, at the end it
is stored as address to something and the address is the same size in any case. So
if i cast it, there should be no changes, but i still got a core dump (it works for
instance in 20 cases, but then one crashes).
Can someone enlighten me what is wrong (or it is correct and i have problem somewhere else?)?
Thank you...
|
|
|
|
|
It's possible but perverse. Technically there is a chance it will be dangerous; for example an explicit specialisation could make the construct unsafe. In practice it could be made to work however.
There is no need to even think about such perversions in your case; a pointer to a derived class can be implicitly cast to a base type. Just use your sample1* s as if they were mybase* s and don't have any casts at all.
Steve
|
|
|
|
|
Why i need it;
http://www.codeproject.com/script/comments/forums.asp?msg=1841069&forumid=1647#xx1841069xx
What i am doing;
i am storing pointer to a vector inside some dispatch table that is stored in a base class for any class i am using.
vector holds further pointers to classes
pointer to vector is stored as void* (to avoid adding #includes to library that i wrote as generic), so i need to
cast it to vector but as i dont have #include to stored class definition the only thing i can cast it to is baseclass*.
when i want to gather its data, i call function in that base class that takes vector pointer
and casts it to vector<baseclass*>*, then i iterate through those class pointers and
gather their data,...
in that process i dont manipulate its content i am just reading what is stored inside and call
stored class* functions.
Unfortunally somewhere in (large and hard to handle) class structure some vector is annoying me
as:
<br />
+ _STL::_Vector_base<serClass *,_STL::allocator<serClass *> > {_M_start=0xcccccccc _M_finish=0x00579264 const serIO::`vftable' _M_end_of_storage={_M_data=0x010cf778 } } _STL::_Vector_base<serClass *,_STL::allocator<serClass *> ><br />
_M_start=0xcccccccc and it crashes.
before that the same freaking code is called around 20 times and it works without any problem.
Whole thing is going on in two processes, sending large class structures via sockets from one to another and vice versa, and is hell to trace so i am trying to theoretically find a problem
-- modified at 3:21 Monday 15th January, 2007
|
|
|
|
|
yeti11 wrote: I have been thinking about; if i have pointer stored inside vector, at the end it
is stored as address to something and the address is the same size in any case. So
if i cast it, there should be no changes, but i still got a core dump (it works for
instance in 20 cases, but then one crashes).
I am not sure what you are trying to accomplish, but if a vector is auto-expanding, any pointers would no longer relate to the current location in memory. This is one reason why pointers are discouraged with STL, and even iterators have to be used cautiously. Both an advantage and disadvantage, STL automatically allocates, and reallocates memory to extend itself.
The iterators/pointers will be valid only as long as the size of the vector remains the same, when you add to the vector, depending on its current size, it could expand to fit the new information, and change memory location.
http://groups.google.com/group/comp.lang.c++/browse_thread/thread/d6fa8209e754aab9/11c794375a7bd8a3%2311c794375a7bd8a3[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
I will try to explain it in an answer to Stephen Hewitt, please check it there...
|
|
|
|
|
You can't convert a vector<sample1*>* to a vector<mybase*>* because those two types are not in a base-derived relationship. It's that simple. It doesn't matter what type is contained in the vector.
As has already been stated, the right way is to remove the cast and do the conversion to mybase* on the individual elements as you access them.
|
|
|
|