|
One thing off the top of my head. Make sure that the combobox is big enough to display the dropdown. It may be showing the dropdown but the control isn't big enough for you to see it. There appears to be two sizes for the combo. One size is what you see and the other is with the dropdown. At least, that's how I look at it.
Artificial intelligence is no match for natural
stupidity.
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
I can see the values in the editbox portion of the combo when I cycle through the mouse wheel, but the dropdown doesn't show up. I can't find a method to change the dropdown size, and it's not in the properties dialog.
|
|
|
|
|
Ahh, found in another recently posted thread.. I needed to click the 'down button' in the resource editor, and then it will allow me to resize the display rect, but only after clicking on the down button. Weird. I don't remember that . Oh well, thanks for your help Anon
|
|
|
|
|
That's the thing. That one bit me a time or two.
You're welcome.
|
|
|
|
|
I am creating a little console application in C++. The application is suppose to opens an html page using ShellExecute() wait for the html page to be closed and start a setup program using CreateProcess(). The problem I have is that both the html page the setup program start at the same time. I need the setup program to wait for the html page to be closed. I used WaitForSingleObject(), but it is not working. Any help would be appreciated, thanks. My code kinda looks like this:
Handle handle;
ShellExecute(handle, "open", filePath, ...);
if(WaitForSingleObject(handle, INFINITE)
{
CreateProcess(NULL, path, ...);
}
|
|
|
|
|
Well...
The first argument to ShellExecute, if I am not mistaken, is a WINDOW handle.
So, you can not wait on window handles with WaitForSingleObject.
Secondly, WaitForSingleObject will RETURN a value, like WAIT_FAILED if you pass it crap, which you have done. You should check the return value against WAIT_OBJECT_0 to imply success.
You should probably try to figure out which program is associated with the HTML file you are opening, and CreateProcess on it as well with appropriate command line arguments. You will get back a process handle as a successful result of the CreateProcess in the PROCESS_INFORMATION, and you CAN wait for this handle to be signaled to indicate the application has ended.
As an alternative, you might want to try getting ShellExecuteEx to work. It at least MIGHT return a process handle you can wait upon. Read its notes very carefully, however.
|
|
|
|
|
Thanks for suggesting that I use ShellExecuteEx. It gave me the handle that I needed to pass into WaitForSingleObject before calling CreateProcess.
|
|
|
|
|
Using Visual Studio 6.0, C/C++
=== Question 1
I am using the Workspace | ResourceView | Version
to input my current version info.
How do I read that info from within my code, so
that I can display it to the User on their demand?
=== Question 2
I am writing a Dialog-Based program. Is there any way to
show the User the About Box?
Many thanks,
Robert
|
|
|
|
|
Check out VerQueryValue() and GetFileVersionInfo() .
Robert Palma Jr. wrote:
I am writing a Dialog-Based program. Is there any way to
show the User the About Box?
Yes. If you used AppWizard, it was one of the choices.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thank-you David, I am working on it.
Sounds like I have to read the version
info FROM the file on the HD, rather than
being able to read it from the image that
is currently in memory.
Thanks again,
Robert
|
|
|
|
|
I am not sure about your statement.
If you have the module handle (an image in memory), I think you can load the version resource from that as well, meaning you CAN get the version information from an image in memory.
I have not done this before, but this is what I would try to do:
For an image in memory, you can try FindResource -> LoadResource -> LockResource -> Use pointer in call to VerQueryValue -> FreeResource .
I think you can use SizeofResource if you need total size of resource information (in lieu of GetFileVersionInfoSize ).
You are using FindResource, LoadResource, and LockResource instead of GetFileVersionInfo .
FreeResource is called when you are done so that the memory is freed.
|
|
|
|
|
Here's the problem...
There are two DLLs, one is storing data and the other needs access to the same data. The data is not a fixed size - right now I'm adding objects to a vector to keep track of it. The DLL with the data is called by an application, not the other DLL that needs the data.
Using a shared data section -
#pragma data_seg(".shared")<br />
vector<SignalGroup> theVector; <br />
#pragma data_seg()
and using the linking command /SECTION:.shared,S
- doesn't work, I'm guessing because of the variable size of the vector.
Is memory-mapping the right route to take here? The size of the data block has to be specified with that as well I believe...
Thanks for any help.
|
|
|
|
|
I believe that creating a shared memory segment using Memory Mapped files is one of the better ways of sharing data between processes. You have to be careful about the size though, because that kind of shared area uses the paging file (IIRC).
Watch out for syncronizing access to the area, if you need to add and remove items from it.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hello!
Im trying to convert an HBITMAP from a third party image class.. so that i can draw the image in a CView.. I have initialized all properties already except the bmiColors of the BITMAPINFO*. How do you initialize this, lets say for example i have 256 colors and 16 bits in the image? do i use RGB values or realized palettes?
having a hard time with this one?
tnx in advance.
maverick
|
|
|
|
|
16-bit image = no palette
256 colors implies an 8-bit image
the palette lives between the end of the BITMAPINFOHEADER and the start of the pixel data. you can find its size by calculating (1 << bmih.biBitDepth) * sizeof(RGBQUAD) .
a little pointer arithmetic will get you to the start of the palette: (address of the BITMAPINFOHEADER + sizeof(BITMAPINFOHEADER))
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
i got the position/address of the palette.. what do i do next? what values do i initialize i wih ?
|
|
|
|
|
Hello,
Is it possible to add an executable to a VC++ project. The project I am working on makes use of various smaller programs. Is there any way to combine these programs into my own program so that they don't have to be present in the same location as my own executable? I hope this makes sense.
Thanks very much,
dlarkin77
|
|
|
|
|
You can add them as resources, unpack them to the temp directory, run them and delete them after that.
Do you have the source code of these small executables?
If so, then why don't you include then into the main app?
Don't try it, just do it!
|
|
|
|
|
Hi Alexander,
Would you have some sample code to do this? I don't have the source code for these executables.
Thanks very much,
dlarkin77
|
|
|
|
|
If Alexander's suggestion is what you are after, see here for an example.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I use the following line to create my file:
CStdioFile fileWrite (m_sSave, CFile::modeCreate);
and the following line to write to file:
fileWrite.Write (n_buffer, sizeof (n_buffer));
Where n_buffer is a nonempty CString. But even though the file gets created successfully it stays empty. Am I missing some command?
|
|
|
|
|
now I added fileWrite.Close(); instead of relying on default destructor, and it keeps throwing "Disk full while accessing C:\...\file" at me despite the fact that I have 50 GB of free space left on my computer.
|
|
|
|
|
Anonymous wrote:
it keeps throwing "Disk full while accessing C:\...\file" at me despite the fact that I have 50 GB of free space left on my computer.
Strange, since you are only writing 4 bytes.
fileWrite.Write (n_buffer, sizeof (n_buffer));
"sizeof (n_buffer)" returns the size of the pointer 'n_buffer'
(which is 4 bytes on a 32-bit system) not the size of the buffer.
Steve T
|
|
|
|
|
FlyingTinman wrote:
"sizeof (n_buffer)" returns the size of the pointer 'n_buffer'
n_buffer is a CString object, not a pointer. Your point about misusing sizeof is still valid, however.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Try:
CFile::modeCreate | CFile::modeWrite
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|