|
What does the next line do? What kind of problem does the next line make to be execute? tell a little more about your problem...
|
|
|
|
|
Here when I open a application which is a server, the mounted file systesm should create a corresponding directory.So next line is to Check for the folder in fs.
This command executes imeediately and returns no folder.
|
|
|
|
|
Is'nt ShellExeute helping you?
|
|
|
|
|
WaitForInputIdle or GetExitCodeProcess may help?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I am using below function and its working fine for now.
DWORD dwExit = WaitForSingleObject(piProcessInfo.hProcess,5 * 10000);
This is incorporating required delay.
|
|
|
|
|
I think that's the only way. (up to my knowledge) because GetExitCodes just get the termination status. May be after waiting , you can check for STILL_ACTIVE status. But your design sounds little bad. What is that you are trying to do? May be you could synchronize your processes with kernel objects like Events. That would be a better solution.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Hello all,
One of my works requirement is customizing the context menu in inspector window of a MS outlook.
Details regarding it are as follows:
when we right click on a email-id(the one that is in front of a From: or To: ),
a context-menu pops-up.I want to add some items in it.
How this can be done? and what events should be handled?
i am writing a component in vc++ & working with outlook 2003.
reply me on n.chudekar.31@gmail.com
thanks in advance.
|
|
|
|
|
at last i got the solution...
anyone facing the same problem, you can visit following two sites everything will be
cleared then.
http://www.outlookcode.com/news.aspx?id=41[^]
http://www.crmreports.com/index.php/additional-actions-when-right-clicking-a-from-or-to-address.html[^]
cheers,
|
|
|
|
|
Hi,
I just saw a example of something I was trying to do on MSDN doing tcp sockets methods in its own thread
the exmpale head Csockets as derived Class With CWinThread as the Base
class CSockThread : public CWinThread my questions where would the code start executing I know Cwinthread has a
CreateThread method but that doesn't specfy where the code starts executing
thankx
|
|
|
|
|
The code starts execution in CWinThread::InitInstance[^]. YOu can override this in your derived class.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
So that would be my start thread function ????
looking at the Win32 API it would be the lptartAddress ?????
HANDLE WINAPI CreateThread(
__in_opt LPSECURITY_ATTRIBUTES lpThreadAttributes,
__in SIZE_T dwStackSize,
__in LPTHREAD_START_ROUTINE lpStartAddress, <------
__in_opt LPVOID lpParameter,
__in DWORD dwCreationFlags,
__out_opt LPDWORD lpThreadId
);
Can I give each Instance it own name to differanitate it via SetThreadName
|
|
|
|
|
You do not start a CWinThread derived thread using Win32's CreateThread[^] function. CWinThread 's purpose is to wrap the low level details behind the raw Win32 methods in a nice little object oriented package. The documentation[^] on CWinThread contains the following:
To create a thread, call AfxBeginThread. There are two forms, depending on whether you want a worker or user-interface thread. If you want a user-interface thread, pass to AfxBeginThread a pointer to the CRuntimeClass of your CWinThread-derived class. If you want to create a worker thread, pass to AfxBeginThread a pointer to the controlling function and the parameter to the controlling function. For both worker threads and user-interface threads, you can specify optional parameters that modify priority, stack size, creation flags, and security attributes. AfxBeginThread will return a pointer to your new CWinThread object.
Instead of calling AfxBeginThread, you can construct a CWinThread-derived object and then call CreateThread. This two-stage construction method is useful if you want to reuse the CWinThread object between successive creation and terminations of thread executions.
Note: The CreateThread mentioned in the above quote is CWinThread::CreateThread , not Win32's.
Always be wary when mixing the low-level (::CreateThread ) with the high level (CWinThread ). If you don’t know how the two relate and the manner in which the high level is implemented in terms of the low level you can easily get into trouble.
Steve
|
|
|
|
|
My point Being using The CwinThread::CreateThread Method there doesn't exist a way of pointing to the Starting executing Function
I know There is the Overridable Function CwinThread:: initinstance() is where the Code starts executing but
thats not the The starting thread function
in MSDN examble for CSocket::Attach
link below
http://msdn.microsoft.com/en-us/library/z2h4xz23(VS.80).aspx
which has Derived Csocket and a Base CWinthread e.g.
Class Csocket : pucblic Cwinthread how can specfiy the start function I guess you can'nt
|
|
|
|
|
Whenever I am debugging, I have this set of windows available to me, say memory, watch, call stack and breakpoints. If I click on one of the windows, the set of windows available changes. How do I make it not do this and just have a consistent set of windows?
Grache'
----------------------------------------------------------
Lorem ipsum dolor sit amet.
|
|
|
|
|
I have basic knowledge of C and C++(basically can read the code to understand what its doing and basically write a small utility here and there in C or C++). However for the last couple of days I am trying to research on the API's. I have seen examples being used in Visual Basic and haven't been able to come across a good sample or document as to how I could use the API in C++ or I might have just not understood it.
I personally would prefer doing a project in VB however am being told I will reach my limitations with VB within hours and am better off with either using C or C++.
Here are the API's I am trying to find examples with or any articles to try and understand with examples would be a great start. I just don't want to start and have to ask questions every hour...
The main API's I am intrested in are :
If I can I will explain this from some of the documents and the usage I have seen in VB.
A) WindowFromPoint(X, Y)...This has to be the point I am looking for on my desktop and it could end up being an external window or my own window at that location. Obviously no point to point it to my own window.
For usage in C++ I would be storing the return valuse in a long variable or do I have to declare my variable as a HANDLE?
C++ usage
1) HANDLE h = WindowFromPoint(499,15)
OR use as
2) Long h
h = WindowFromPoint(499,15)
////
B) GETDC(h) This is getting the device context from using the handle we just passed. However what is the return value for this...VB example states its long?
1) Long h
hd = GetDC(h)
C) BitBlt (Destination picture object's.hdc, a RECTANGLE BLOCK, hd we got from B above, nect two parameter 499, 15 used in the WindowFromPoint, COPY)
Please am I on the right track with this 3 API's.
Thanks a million.
|
|
|
|
|
WindowFromPoint[^] has the following prototype:
HWND WindowFromPoint(POINT Point);
As can be seen, the return type is HWND , not HANDLE . Also, it takes a POINT point structure, not two numbers. Try something like this:
HWND h = WindowFromPoint(POINT(499,15));
Steve
|
|
|
|
|
Thanks Steve for your reply.
However I haven't started coding this yet...I am still looking for documentation or something to refer to before I start coding.
However you could help me if you can by answering a couple of questions...the 3 Api's in VB examples and other documentation I have seen been used in VB. Am I right in saying If I create a Picture control in my application and having passed the correct parameters to the 3 API's, I should be able to get a portion of the desktop in that picture button?
Or is there a better way...All I am trying to do is from point 499,15 I need that section in a picture control of size height 615 and width of 375.
I guess it is doable all I have to do is make sure I pass the right parameters?
|
|
|
|
|
FISH786 wrote: I should be able to get a portion of the desktop in that picture button?
What do you mean by "get a portion"?
Steve
|
|
|
|
|
Like the source window is 800 X 600 however i only want a rectangular block of 17 X 22 from point 499,15. Into my application.
|
|
|
|
|
What, you mean you want to do a screen capture of a portion of the picture control?
Steve
|
|
|
|
|
No Screen Capture of a portion of a window into a Picture control.
|
|
|
|
|
Hi,
I am wanted to convert/store a string, which has XML elements, into a dataset or data table. The string that I am reading from a service is the result of my query. I have written the following code,
{
DataSet ds = new DataSet();
StringReader stream = new StringReader(xmlString);
ds.ReadXml(stream);
DataTable dt = ds.Tables[0];
dg.DataSource = dt;
return dt;
}
I am receiving two different type of strings, they are
xmlString1:
<?xml version="1.0" encoding="UTF-8"?>
<nh:rows xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nh="http://nhdb">
<nh:urnumber>0123456</nh:urnumber>
<nh:surname>xxxxx</nh:surname>
<nh:forename>yyy</nh:forename>
<nh:middlename></nh:middlename>
<nh:dob>1958-10-05</nh:dob>
<nh:address>Mxaxixlx</nh:address>
<nh:suburb>Prxxxx</nh:suburb>
<nh:state>Vxxx</nh:state>
<nh:postcode>3072</nh:postcode>
<nh:patientphone>phone</nh:patientphone>
<nh:gender>Female</nh:gender>
<nh:unit>Sxxxxx Oxxxx</nh:unit>
<nh:ward>Bxxx DPxx</nh:ward>
</nh:rows>
xmlString2:
<?xml version="1.0" encoding="UTF-8"?>
<nh:rows xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nh="http://nhdb">
<nh:urnumber>0123450</nh:urnumber>
<nh:surname>Cxxxxxx</nh:surname>
<nh:forename>RxxxxxT</nh:forename>
<nh:middlename></nh:middlename>
<nh:dob>1954-07-19</nh:dob>
<nh:address>'ANNANDALE'</nh:address>
<nh:suburb></nh:suburb>
<nh:state></nh:state>
<nh:postcode></nh:postcode>
<nh:patientphone></nh:patientphone>
<nh:gender>Male</nh:gender>
<nh:unit></nh:unit>
<nh:ward></nh:ward>
<nh:urnumber>0123451</nh:urnumber>
<nh:surname>KROL</nh:surname>
<nh:forename>ANILLA</nh:forename>
<nh:middlename></nh:middlename>
<nh:dob>1958-12-10</nh:dob>
<nh:address>68A CLARENCE</nh:address>
<nh:suburb></nh:suburb>
<nh:state></nh:state>
<nh:postcode></nh:postcode>
<nh:patientphone></nh:patientphone>
<nh:gender>Female</nh:gender>
<nh:unit></nh:unit>
<nh:ward></nh:ward>
<nh:urnumber>0123452</nh:urnumber>
<nh:surname>GEYER</nh:surname>
<nh:forename>MAUREEN</nh:forename>
<nh:middlename></nh:middlename>
<nh:dob>1948-06-02</nh:dob>
<nh:address>19 JAYSON</nh:address>
<nh:suburb></nh:suburb>
<nh:state></nh:state>
<nh:postcode></nh:postcode>
<nh:patientphone></nh:patientphone>
<nh:gender>Female</nh:gender>
<nh:unit></nh:unit>
<nh:ward></nh:ward>
</nh:rows>
The above code works perfectly for the xmlString1 and it is converting a data table with single row of data for the cloumns urnumber, surname, forename, middlename, dob, address, suburb,state, postcode,patientPhone, gender, unit, ward.
When I am receiving the xmlString2, the data table is populated with only one column urnumber_Text(for all ur numbers in the xml string).
What am I missing here? Is there any other genuine way of doing it?
Thanks a Lot for your valuable time and invaluable advice.
Looking for advice,
Renu
|
|
|
|
|
I'm using HttpSendRequest to POST data to a secure web page. Will the function automatically re-post the data if a reply isn't received in a certain time? The author of the destination web page claims they are receiving the post twice (30 seconds apart) but I'm 99.9% sure there is only one call to HttpSendRequest from my application. If the reply is received in a few seconds there's no problem.
|
|
|
|
|
Hi,
I recently started my first project based around DLLs and have run into a little trouble.
I followed this tutorial: http://www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855
The code is split up into a header file and a source file.
It consists of a namespace, which contains variables and a class.
I am linking implicitly.
In a test program I can access the variables fine, no problems there, but when I use a function from the class, I get linker errors, eg:
<pre>1>ELQTest.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl ELQ::Functions::CreateRot(void)" (?CreateRot@Functions@ELQ@@SA_NXZ) referenced in function _SDL_main</pre>
Now for some code:
DLL Header:
#ifndef _ELQDLL_H_
#define _ELQDLL_H_
#include <SDL.h>
#include <cmath>
#include <windows.h>
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#if defined DLL_EXPORT
#define DECLDIR __declspec(dllexport)
#else
#define DECLDIR __declspec(dllimport)
#endif
namespace ELQ{
extern "C"{
#pragma data_seg (".globals")
DECLDIR bool keyboard[27], open;
DECLDIR double sins[720], coss[720], v, posx, posy, posz, f, h;
DECLDIR int WIDTH, HEIGHT, DEPTH, BPP, q, speed, theta, *map, o, lx1, ly1, lx2, ly2, lx3, ly3;
class Functions{
public:
static bool CreateRot();
};
}
}
#endif
DLL Source:
#include "ELQDLL.h"
#define DLL_EXPORT
#if defined DLL_EXPORT
#define DECLDIR __declspec(dllexport)
#else
#define DECLDIR __declspec(dllimport)
#endif
namespace ELQ{
extern "C"{
#pragma data_seg (".globals")
DECLDIR bool keyboard[27], open = false;
DECLDIR double sins[720], coss[720], v, posx, posy, posz, f = 10, h;
DECLDIR int WIDTH, HEIGHT = 10, DEPTH, BPP, q, speed, theta, *map = NULL, o, lx1, ly1, lx2, ly2, lx3, ly3;
DECLDIR bool CreateRot(){
for(int x = 0; x < 720; x++){
sins[x] = sin((x-360)*0.017);
}
}
}
#include "stdafx.h"
#include "ELQDLL.h"
#include <iostream>
SDL_Surface *screen;
int main(int argc, char *argv[]){
if(ELQ::Functions::CreateRot())
system("PAUSE");
return 0;
}
Any idea what could be wrong?
I've played around with all sorts of combinations of class definitions, export/import symbols etc, yet cannot get this to work.
Look forward to your input,
Thanks,
Nat.
PS: Oh, I should say that when I compile the DLL, I get a stream of inconsistency messages, could this be related?
"Sir, I protest. I am NOT a merry man!"
|
|
|
|
|
Those extern "C" statements look wrong - especially as a) you're using namespaces and b) you're enclosing class definitions in them. Now, namespaces and classes are C++ features - they really aren't compatible with extern "C" , which specifies that the names enclosed by the extern "C" are exported as undecorated, C names rather than decorated C++ names.
BTW - a decorated C++ name is something like ?CreateRot@Functions@ELQ@@SA_NXZ , your missing symbol...
So - try removing all extern "C" things. The only reason for extern "C" is to export functions compiled with a C++ compiler in a form compatible with C. You're exporting namespaced functions and classes - they will never be compatible with C...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|