|
Hi there,
I have created an application in MDI using single document. I have 2 views, view1 and view2. I have a menu in toolbar, consists of view1 and view2. if i select view1 from the menu, then that particular view must be activated and same in the case of view2. One important thing is iam not hidding the views. Both must be present on the parent window. If any one knows about this, plz reply fast. Thanking you.
Sreeram.
Sreeramachandra G
|
|
|
|
|
Well have a look at CMDIFrameWnd::MDIActivate
|
|
|
|
|
Anyone has a solution to my problem??
The problem is like this:
I need to write an application using Visual Basic 6 which calls a DLL function (Function1) to do some task. Inside this DLL function (Function1), it calls another function in another DLL to do initialization (Function2). THis is done to minimize code repetition as i have another DLL function (Function3) that calls Function2 DLL for initialization as well.
In Visual C++ testing, everything was fine as i use dependency. When i port over to Visual Basic using
Declare Sub Function1 Lib "D:\Function1.dll" ()
Declare Sub Function2 Lib "D:\Function2.dll" ()
Declare Sub Function3 Lib "D:\Function3.dll" ()
It says D:\Function1.dll not found when i use
Call Function1
in my Visual Basic Application although the file is physically there.
If in Function1 in Function1.dll does not call Function2 in Function2.dll, it is ok. I even try to use _dllimport method to import Function2 into my Function1 through some web searching but the problem is still the same.
Hope some experts can enlighten me.
Thanx.
|
|
|
|
|
i'm sorry, but this is the wrong forum for that question!
Don't try it, just do it! 
|
|
|
|
|
then, where u suggested i post this question...???
Thanx
|
|
|
|
|
I have a child window for painting JPEGS onto into a dialog by processing the WM_PAINT message by using the following code: (also I forgot to mention that it's subclassed and in the new window procedure I process this message)
case WM_PAINT:
hDC = BeginPaint(hwnd, &ps);
if (gpPicture != NULL)
{
}
EndPaint(hwnd, &ps);
I need to repaint the background without an image so different sized images do not overlap so I set gpPicture to NULL and call InvalidateRect(hwnd, NULL, TRUE) but this does not seem to erase the background before the next JPEG is loaded. How do I get around this?
|
|
|
|
|
InvalidateRect doesnt mean that something is cleared!
handle the case that gpPicture==NULL and use e.g. FillRect to clear the window background.
Don't try it, just do it! 
|
|
|
|
|
I want to create an application based on SDI.In this app ,I call a dialog to do control-work.I want to classify the control-work , and every control-work can be done by another dll based on dialog that had been compiled.
I want to do that by laying some button(or other control) on left side of the dialog,and display specific dll-dialog on the right side of the dialog when button is clicked.That is, I want to call this dll-dialog like call property page,just switch but not pop-up.
Give me some suggestion ,the best is code.
My email is happywolf530@eyou.com
Please pardon me for my poor representation.
Thank you!!!
|
|
|
|
|
is there a tool which can monitor all of events (genereted by SetEvent() function ) inside a PC?
thx.
includeh10
|
|
|
|
|
i need to get communication data from a socket.
the socket is between 2 apps, they use local-port (actually one is java.exe, another is jdb.exe).
i need to find real protocol they are using.
silly sun's docs are not correct at all - i never see any docs worse than that.
thx.
includeh10
|
|
|
|
|
use a winsock/network monitor and have a look at the traffic yourself!
Don't try it, just do it! 
|
|
|
|
|
Hello i am Mujtaba having problem in a visual c++ program. In that program i have used liberaries means(abc.lib etc) from path where it is stored.When i execute program it compiles sucessfully but on running give this error
LINK:fatal erro LNK1104: can not open file "C:\Program.obj"
looking for help Mujtaba
|
|
|
|
|
r u add the path for library in option box
|
|
|
|
|
My program is a multi monitor application . I want to set the other monitors as extended screen of the primary screen in program when I need . I know it can be done in windows control panel ,but I hope to do it by myself. I don't know how and where to find the api to do that.
Any suggestion for me?
Thank you!!
Gemini
|
|
|
|
|
code is the best.
thank you!;P
Gemini
|
|
|
|
|
Hi!
I read some articles about docing control bar. But that isn't what i need.
I create a modeless dialog in mainframe. it is fixed size (for example 128*128), and on top of all childframe(views). I hope the dialog has the docking capability to align itself to some corner of the mainframe. But don't know how to do it.
I try MoveWindow to 0, 0 (left corner of mainframe), but it cover the toolbar!
the client rect of mainframe including the area toolbar accupied. But childframe is smart to know the right size and position when it resize to largest. How can childframe know the exactly free space in mainframe?
Any suggestion for me?
Thank you!!
|
|
|
|
|
|
sorry, what i wanna is just a modeless dialog not control bar.
I write a large image's browser. There is a modeless dialog which show the overview of whole image. It is on top of all the views. Its size is about 200*200, if I take a docking control bar, it will take the space 1024*200 that waste two much space.
It just like photoshop, the panels of all kind tool on top of image. But I wanna my modeless dialog has a docking capability.
In fact, it is also acceptable to make this dialog just on the left corner of the free space in mainframe. But I need the rect in the mainframe beside the toolbar, for GetClientRect doesn't get rid of the space toolbar occupied.
|
|
|
|
|
The easiest method of getting the available rectangle that you can use to position your modeless window is like this:
CRect rcAvailable;<br />
RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposQuery, &rcAvailable );<br />
rcAvailable then contains the client rectangle without the toolbars.
Hope this helps.
|
|
|
|
|
I'm writing a program that open a text file, then display only the
first 4 lines and the last 4 lines to screen. <this is="" a="" win32="" console=""
program="">
However, I can't even open a file to display to the screen??? What's
wrong?
Please help.
<br />
<br />
void display_file()<br />
{<br />
<br />
ifstream ins;<br />
ofstream outs;<br />
string inFile;<br />
<br />
cout << "Please Enter the file name: " << endl;<br />
cin >> inFile;<br />
ins.open(inFile.c_str());<br />
if (ins.fail())<br />
{<br />
ins.clear(); <br />
cout << "*** ERROR: Can not open file " << endl;<br />
}<br />
string line;<br />
int lineCount = 0;<br />
getline(ins, line);<br />
while (line.length() != 0)<br />
{<br />
lineCount++;<br />
outs << line << endl;<br />
getline(ins, line);<br />
}<br />
<br />
<br />
}<br />
|
|
|
|
|
Hi guys, I just accidentally fix it, and now I can display
the whole file to screen.
<br />
while (line.length() != 0)<br />
{<br />
lineCount++;<br />
cout << line << endl;<br />
getline(ins, line);<br />
}<br />
I changed the outs, which is ofstream object, to cout <<.
It works, but I don't know why.
Now another problem arises. I'm thinking of the algorithm to
display only the first 4 lines and the last 4 lines.
Anyone want to share your opinion about the algorithm(not the
code) to me? Anyone know what I just did? outs should work,
but for some reason, I need to use cout <<.
Thanks
|
|
|
|
|
Alex Ngai wrote:
I changed the outs, which is ofstream object, to cout <<.
It works, but I don't know why.
ofstream is used to output to a file. Since you didn't specifically call the constructor for ofstream , it used the default constructor which does nothing, so output to it goes nowhere. cout is the pre-opened stream for writing to the screen (the "console").
- Mike
|
|
|
|
|
Thanks for your reply.
Right now I'm really having a diffcult time to develop the
algorithm to display only the first 4 lines and last 4 lines.
I'm trying to put the stream into the string object, line,
and using string class function to display the last 4 lines.
However, I can only display the first 4 lines. How can I display
the middle one and the last 4 lines?
Any input? Algorithm? Opinions?
Thanks.
Sample run looks like this:
This is line 1.
This is line 2.
This is line 3.
This is line 4.
.
.
.
This is line 12.
This is line 13.
This is line 14.
This is line 15.
|
|
|
|
|
How about you read each line and store it in an array of lines.
As you read each line, shuffle the existing lines through the array and read in the current line.
That way you will always have the last 4 lines in your array.
When you reach the end, just display the contents of your line array.
Be aware that your file may not have 8+ lines. It might have only 2 or it might have six (resulting in the two middle lines being printed twice).
You will have to check for this.
If sex is a pain in the ass, then you are doing it wrong!
|
|
|
|
|
HI!
I face some trouble in set the window's size. It seems MoveWindow set the size of whole window including the header. But I try to set the window has the exact client size I want, for example 128*128. How can i realize it?
|
|
|
|