|
yes, I'm sorry. The second dialog I am trying to use is a modeless dialog that is show when a menu item is selected.
can someone help me calculate the size of my main dialog?
|
|
|
|
|
GetClientRect and GetWindowRect are at your disposal
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
NYTSX wrote: calculate the size of my main dialog?
GetWindowRect()
/ravi
|
|
|
|
|
I have a many C++ windows projects, dlls and librarys. I have done some research to find out what happens if there are similar string IDs in projects, dlls and libraries after they are are linked together.
What happens is the string in the project always replaces the string in the dll or library if there is a string ID match.
Example: I declare string ID 100 as "Chris" in the project, "John" in the dll, and "Bob" in the library. I use CString::LoadString(100) in the dll and CString::LoadString(100) in the library. When these two statements are executed the string "Chris" is loaded from the project string table and not the library and dll.
I was able to solve the similar string issue between projects and dlls useing ::FindResource along with the dlls instance. Has anyone figured out how to have similar strings between projects and libraries?
Chris
|
|
|
|
|
|
So how do you get the instance of a library?
Chris
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
I read the article and there is no mention of a library project. This article deals with string conflicts in DLL projects. My issue is having similar strings with a library project where there is a DLL is not created.
Chris
|
|
|
|
|
You are creating static link libraries with resources in them?
The problem you are having deals with search order. It is very similar to dealing with a PATH variable. The LoadString method looks in its module for a string id. If it finds it, it uses it. Otherwise, it moves on to the static libraries that were compiled into your project (which really shouldn't have resources of their own, but I digress). Finally, it starts marching through the DLLs you have loaded.
This is why you should make sure that your string IDs are unique.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
So there is no way to have the same string id in a project and in a library and have the library string "Win".
Chris
|
|
|
|
|
The reason I am asking this question in the first place is because I have three different languages in all the projects, libraries and dlls. That is why I have string resources in libraries.
Chris
|
|
|
|
|
The better way to handle that case is to make each language its own resource dll and to allow the user to select which language they want to use (or detect what Windows is using when the application starts up). Then you would just load that DLL. There is an example of how to do that in an article on this site (I believe it is in the DLL section).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
It almost sounds like you need AFX_MANAGE_STATE(AfxGetStaticModuleState()) at the top of the routine that calls LoadString() . This is just a guess, however.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This looks very interesting. I have never used AFX_MANAGE_STATE(AfxGetStaticModuleState()) before. I am not useing LoadLibrary() anywhere in the projects. I just put the library location in the linker of Microsoft Visual Studios 6.0. Also I wonder if AFX_MANAGE_STATE would even work because the description of this macro is "Call this macro to protect an exported function in a DLL." I am not sure if this would work with a library or not.
Chris
|
|
|
|
|
chris175 wrote: I am not useing LoadLibrary()...
I meant LoadString() .
chris175 wrote: Also I wonder if AFX_MANAGE_STATE would even work...
It very well may not. Your problem just sounded like one that the macro was designed to resolve (e.g., a DLL and an EXE both having a like-numbered resource, but the wrong one gets loaded).
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Does anyone know of a sample MS Visual C++ program that takes raw black and white video data (saved as a binary file) that is transmitted at 3 frames/sec and shows them on the screen at the same rate?
if not, is there an article that explains how to do this in Visual C++?
thanks in advance.
-- modified at 10:10 Wednesday 2nd August, 2006
Kitty5
|
|
|
|
|
|
If (1) your "black & white video data" is actually "8-bit grey-scale" (which is what one might expect from a video camera), and (2) the image size is fixed (number of pixels horizontal & vertical is known), it could be quite easy.
Create a window to use to display the images
Create a bitmap header.
Set the bitmap parameters (number pixels X & Y, pixel depth, not using pallette, etc)
Read the binary file into some area in memory
Set the bitmap header "data" parameter to point to your data
Use SetDIBitsToDevice to display it in your window.
Repeat the last 3 steps until stopped
If the video has unusual attributes (for example, it is 12-bit greyscale from a medical imager, or if it is in columns not rows) you will probably need an intermediate step, to create a bitmap which Windows understands.
|
|
|
|
|
Hi all,
Ok, this may sound like i'm repeating myself, but does someone know how to validate just the username on the domain, to check if it is a valid username found on the domain.
I know about the funcion logonUser(), but the function doesn't work without a password parameter.
Plz help
Thanx
Regards
Programm3r
|
|
|
|
|
Try NetUserGetInfo() .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I newly added one button in my dialog as CConfigure class.
When i double click the button the member function came,then when i click OK it shows the error as
"Error while updating files(Confiugre.cpp,configure.h) for CConfigure class"
Whats the meaning of that?The ID and function is get placed in classwizard...but i cannot code for that function..What can i do?
Anu
|
|
|
|
|
try deleting the clw file in the project folder and recreating it( by pressing ctrl + W it will be created again).
And even if there is no classwizard, u can Manually add the message map entry and the function
nave
|
|
|
|
|
hi,
i hv a small problem...i m using ClistCtrl, and to launch a file open user has to double click..now even if the user clicks on the white portion where name of file is not written, still the file is opened. reason being that the ItemRect is the complete Rextangle and if the size of name of file is say 2 chars then the rest portion is white in the Bounding rectangle, but when clicked the item is identified and the file opened. for the user it becms difficult if there r multiple columns n hence he thinks that the area between the columns is white so does not belong to the item...
Can anyone suggest me a way out....
Thanx in advance..
|
|
|
|
|
Use CListCtrl::HitTest(..) with LVHT_ONITEMLABEL flag
-- modified at 8:02 Wednesday 2nd August, 2006
the flag is a out parameter and you have check the flag as (LVHT_ONITEMLABEL & flag)
Do your Duty and Don't expect the Result
|
|
|
|
|
Hi, I saw in one application,i debuged that.
When the control goes to SendMEssage(WM_KEYDOWN,49,0) in one class after executing that class the controls goes to OnKEyDown() in another class,there they pass that
Case 49:
CString Str + ="1";
I dont know how the controls goes to that class automatically..for that particular WM_KEYDOWN.
It may be a silly question but i need that.
I am going to do this in my appl.
Anu
|
|
|
|