|
elephantstar wrote:
stStartUpInfo.dwFlags = STARTF_USESHOWWINDOW;
stStartUpInfo.dwFlags = STARTF_USESIZE;
stStartUpInfo.dwFlags = STARTF_USEPOSITION;
You're overwriting the dwFlags value in each statement. You need to OR the values:
stStartupInfo.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESIZE | STARTF_USEPOSITION;
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
In addtion to the error pointed by Ryan Binns. I feel still there are other problems to accomplish the required behaviour. ie, The values in the STARTUPINFO structure are used only if the spawned application creates its window with CW_USEDEFAULT Style. In the case of word, it takes the startup position from the following registry key.HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Data AFAMK.
suhredayan There is no spoon.
|
|
|
|
|
What do you mean if the spawned applicaton creates its window with CW_USEDEFAULT style? Do I need to call CreateWindow() and then CreateProcess? I'm a bit confused.
|
|
|
|
|
elephantstar wrote:
What do you mean if the spawned applicaton creates its window with CW_USEDEFAULT style?
If the process that you create via CreateProcess() is a GUI application, it will eventually call CreateWindow() to create its main window. Read about CreateProcess() here. Notice that several of the parameters are ignored unless the new process calls CreateWindow() with CW_USEDEFAULT .
elephantstar wrote:
Do I need to call CreateWindow() and then CreateProcess?
No, the call to CreateProcess() is fine.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
CreateProcess() is being called from a child window class (CMDIChildWnd) if that changes things. I see what you're saying in that CreateProcess() calls CreateWindow but how to I access CreateWindow to make the change?
|
|
|
|
|
elephantstar wrote:
I see what you're saying in that CreateProcess() calls CreateWindow...
CreateProcess() does not call CreateWindow() . CreateWindow() is called by the newly created process.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
elephantstar wrote:
PROCESS_INFORMATION *pProcessInfo = new PROCESS_INFORMATION;
Why allocate this on the heap? It's a needless call to the memory manager, not to mention there is no matching delete . A simple stack-based variable will suffice.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
I have made a List Ctrl with column drag and drop feature, but I just want my first column can not be drag and drop! Just like iTunes( the first column:"Song name" can not be drag or drop),but I can not find useful message to do this. Could any one give me some suggestion? Thanks a lot!
pls, any comment is welcome
|
|
|
|
|
vectors and arrays can store linear sequences of numbers. it is often the case taht we want to store collection of number that have a two dimensional layout. such as an arrangement of number consisting of rows and colums is called a multi-dimensional array
in the following example write code that fill a vectore v with the values
1 2 3 4 5 6 7 8 9 10
0 2 4 6 8 10 12 14 16 18 20
1 4 9 16 25 36 49 64 81 100
0 0 0 0 0 0 0 0 0 0
1 4 9 16 9 7 4 9 11
another question
i also don't know how to design a class student.
requirement:
student has several attributes, name and birthday, make a vector
vector<student>friends:
program that reads a set of name and birthdays (type them in)
the output of printing out all friends whose birthday falls in the current month.
please help me !!
thanks a lot !!!!
jemy
|
|
|
|
|
To do this, create a vector of vectors, then you end up with a jagged array.
jemy0130 wrote:
another question
i also don't know how to design a class student.
requirement:
student has several attributes, name and birthday, make a vector
vectorfriends:
program that reads a set of name and birthdays (type them in)
the output of printing out all friends whose birthday falls in the current month.
please help me !!
thanks a lot !!!!
Stop and think about what is being asked - it's pretty straightforward. It's obvious this is your homework. You really should stop and think about your homework, give it a go, then ask *specific* questions when you get stuck. We're not here to do your homework for you. The first part was an example of a specific question (how do I use a vector to make a 2D array), and we're more than happy to help with stuff like that.
I'm pleased to see someone is taking classes that use the STL instead of teaching C with classes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need read content of wave files as data for further mathematical analyses. How do I exctract pure data?
ytvsoftware
|
|
|
|
|
I have an application with an MFC menubar. On those menus there are several options, but only three of them are check/uncheck style. All three of these become disabled whenever a particular dialog box is called upon. This only occurs when that particular dialog box is brought up.
In the OnUpdateMenuItem(CCmdUI* pCmdUI) for each of the three items I am explicitly calling pCmdUI->Enable().
Any ideas as to what is causing this? There are no explicit Disable commands in the dialog's source code.
|
|
|
|
|
RtlCopyMemory (ddcamVideoData, lpVHdr->lpData , lpVHdr->dwBufferLength );
^ ^
^ ^
could some of you tell me that what's the function of the arrow??
Thanks alot!
|
|
|
|
|
Francis Chau wrote:
could some of you tell me that what's the function of the arrow??
Arrows are used shoot from a bow !
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
Arrows are used shoot from a bow !
|
|
|
|
|
The arrow is the member-dereference operator. Whenever you are using a pointer, you use an arrow rather than a dot to access its members.
|
|
|
|
|
|
CString behave unpredictable when i assign it a LPTSTR buffer.
like below
UINT nSize = GetCurrentDirectory(0,NULL);
CString temp;
LPTSTR lpBuffer = temp.GetBuffer(nSize);
GetCurrentDirectory(nSize, lpBuffer);
CString strINIFilePath = lpBuffer;
after assignment CString contains garbage, and also i am using _UNICODE for unicode compilation.
|
|
|
|
|
The code dosen't seems to have any problem.
But just a vague guess. if you are using VC 6. Select "Tools -> options ->
Debug -> Display Unicode Strings"
suhredayan There is no spoon.
|
|
|
|
|
Where's the call to ReleaseBuffer() ? Do temp and lpBuffer also contain garbage?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
Where's the call to ReleaseBuffer()?
DavidCrow,
i'm pretty sure the problem faced is not due the missing call to ReleaseBuffer(). Coz "ReleaseBuffer method releases a buffer allocated by GetBuffer."
Even if Ali_quadin had to call ReleaseBuffer() it should be after the line " CString strINIFilePath = lpBuffer;" but by this time the strINIFilePath is already memcpyed from lpBuffer and it is supposed to have the copy of it.
Pls correct me if i'm wrong.
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
i'm pretty sure the problem faced is not due the missing call to ReleaseBuffer().
Empirical testing would be the only way to know for sure. Given that ReleaseBuffer() must be called before any other CString method, I stand by my claim.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
Given that ReleaseBuffer() must be called before any other CString method, I stand by my claim.
But Ali_quaidian dosen't call any of the temp objects method, after temp.getbuffer(), so i'm finding difficult to understand the revelence of ReleaseBuffer() in this problem.
suhredayan There is no spoon.
|
|
|
|
|
suhredayan® wrote:
...i'm finding difficult to understand the revelence of ReleaseBuffer() in this problem.
Sorry, my bad.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|