|
Thank you very much Mr. Jose Lamas Rios.
I made it now. It really helps me a lot. I can now continue my project. I really appreciated your help here.
By the way, I would like to ask, is there's a way of showing a html that is within the resources but its not declared in .rc. I have read some forum regarding on CHtmlView using LoadFromResource command but it is necessary that all html files in res should be declared in .rc file. And for using Navigate command, the path or directory of the html file is required. If I used the resource path, still it needs to be declared in .rc. Is it possible to view the html file that is not declared in .rc?
Thanks again and best regards. More power to you Mr. Jose Lamas Rios. You're the man! More blessings for you.
With great power comes a great responsibility.
|
|
|
|
|
Hi,
I am trying to put together a Video Clip organizer for all of my captured AVI file clips.
I need to be able to get it to play the clip so that I can see what it was in order to catalog it, so I went for the "simplest" method using MCIWndCreate() and MCIWndPlay() etc...
Unfortunately when I try this, I get a message; "Video not available: Cannot find 'vids:dvsd' decompressor."
But if I just click the clip in explorer, it plays OK in Windows Media Player (v10)....
I am using Visual Studio.net 2003 on WinXP Professional.
At the same time I am using some AVIFile functions within the program to access various stream information from the file; if this is relevant in any way.
Anyone have any idea why this is happenning, and how to fix it, or is there a better way to get the clip to play?
Thanks,
Bryan.
|
|
|
|
|
OK, I didn't have a dvds codec installed on my development machine.
Just installed a frre one and all is well now.
Bryan.
|
|
|
|
|
I am trying to call a Fortran dll in my c++ code.
The fortran bit is as follows:
<br />
subroutine swap(x,y,z)<br />
real , intent(inout) :: x<br />
real , intent(inout) :: y<br />
real , intent(out) :: z<br />
real :: t<br />
!<br />
!DEC$ATTRIBUTES dllexport :: swap<br />
!DEC$ATTRIBUTES DEFAULT, DECORATE, ALIAS: 'swap' :: swap<br />
!<br />
t=x<br />
x=y<br />
y=t<br />
z=1.23<br />
end subroutine swap<br />
<\code><br />
<br />
The C++ calling code is:<br />
<br />
<code><br />
#include <iostream><br />
using namespace std;<br />
extern "C" __declspec(dllimport)void swap(double &x, double &y,double &z);<br />
int main() <br />
{<br />
double x,y,z;<br />
x = 10;<br />
y = 999;<br />
swap(x,y,z);<br />
cout<<x<<"\t"<<y<<"\t"<<z<<endl;<br />
return="" 0;<br />
}<br />
<\code=""><br />
<br />
There are some problems however. x and y are not swapped but they do display their original values on the console. And z has not been assigned a value. I think it's a problem with the C++ bit but I could be wrong. The good thing is that it compiles and executes.<br />
I will eventually try and do this in C# but one step at a time ;)<br />
<br />
Kash
|
|
|
|
|
Kash wrote:
extern "C" __declspec(dllimport)void swap(double &x, double &y,double &z);
Does Fortran support references? What happens if you change this to:
extern "C" __declspec(dllimport)void swap(double *x, double *y,double *z);
...
swap(&x, &y, &z);
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
If that version of Fortran supports pointers, then it probably can support references indirectly. After all, under the hood, a reference is just a pointer without the dereferencing symantics.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hello all,
Could anyone tell me how to obtain the index of the selected item from a CMenu control?
The reason I want it is so that I can call CMenu::GetMenuString(int index,...); My goal is really to obtain the text of the selection. If anyone knows an easier way, I'd be happy to learn it.
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
As the menu selection chnages you receive WM_MENUSELECT messages. You can use this with the command ID to get what you need, unless you need it after the selection has completed and the menu been dismissed.
If you vote me down, my score will only get lower
|
|
|
|
|
The menu is actually a popup menu... View/Doc... can I still use this message?
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
Yes, but you have to map it in the window that owns the menu (the HWND or CWnd parameter passed to TrackPopupMenu)
If you vote me down, my score will only get lower
|
|
|
|
|
Can't you infer the text from the handler function that will get called? In other words, if your menu had "Open", "Close", and "Delete" options, you'd have a handler function for each. In each function you'd know what the text was that got you to that point? Does that make sense, or am I way off?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
The menu is actually a popup menu for an xml generator/editor/validator that i am creating. when you right click on an element, it will popup the menu, which will be populated dynamically with and insert option for every possibly child element (uses a dtd file to determine this at the beginning). However, since this works for any DTD file, the insert event for any element will be handled by the same function. Therefore, I need to get the text, to know which element I will be adding.
I hope this is clear... let me know if it isn't.
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
picazo wrote:
...when you right click on an element, it will popup the menu, which will be populated dynamically with and insert option for every possibly child element...Therefore, I need to get the text, to know which element I will be adding.
This part confuses me. The first part indicates that the text for the menu items will come from a DTD file. The second part indicates that you need to know which menu item was selected in order to get its text. Am I reading that correctly?
What happens currently when a menu item is selected?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Okay, so for a new xml tree, a dtd file is specified... parsed and validated. Structures containing the information for this tree are stored. Once this is done, a skeleton xml tree is generate, and when a user right clicks on a node, a menu pops up that displays options for that node; such as an insert option for any valid child element. When a user makes an insert selection from the menu, I need to know which selection he made so that I know which item to insert.
I guess I don't really need the text for the selection, but rather the index so that I can check my valid children list for the given node and insert correctly.
I figured out how to get the ID of the selected element... using the
m_SelMade = CMenu::TrackPopupMenu(TPM_LEFTALIGN | TPM_NONOTIFY | TPM_RETURNCMD, point.x, point.y, this);
Now all I need to do is make sure to give each of the insert options a unique ID.
Thanks for the help.
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
picazo wrote:
...when a user right clicks on a node...
In what type of control does this node exist?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
picazo wrote:
Now all I need to do is make sure to give each of the insert options a unique ID.
if you are filling the menu dynamically, and I assume that you know all the possibilities that the menu can contain; for example, for node X, you will put item a, b and c, and for node Z, you will put item a, b and d, ... for all node type. so you can manually add unique command ID in your resource.h file for each possible item.
Once that is done, use the return value from TrackPopupMenu, it will give you the ID that was selected because you used TPM_RETURNCMD .
then you can switch on those values ( or use a callback ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
i have generally heard adding WS_CLIPCHILDREN to a parent window reduces flicker and i couldve sworn it has worked for me like that in the past
but im writing an MFC application, it has a main frame tab control, and in the tabbable area i have a splitter with scrollable dialog views in it.
weirdest thing is, if the mainframe has WS_CLIPCHILDREN the Tab control flickers like crazy on resizing (mostly grey while sizing)
but without it it barely flickers at all (still flickers some)
(also i changed the behavoir for OnSize to not make the splitter fill the whole frame area, cause i think this was causing flicker also because i would just immediately resize the splitter back into the tab controls display area)
similarly i noticed that if my CSplitterWnds are created with WS_CLIPCLILDREN then whenever any part of the frame is resized ALL the child panes have TERRIBLE flickering
but when i take WS_CLIPCHILDREN back off of the splitters i have very minimal flickering (just like on the main tab control)
i dont understand why having WS_CLIPCHILDREN on Frames and Splitters would cause so much more terrible flicking for their child windows
|
|
|
|
|
When implementing my own non-dialog window class (e.g., something derived from CWnd), I typically add an OnEraseBkgnd() message handler, and change it to return TRUE (to indicate further erasing by the MFC framework is not needed). Sometimes, this helps me when trying to reduce flickering.
In your case, I think one of the root causes of flickering may be the use of the MFC tab control. I usually try to avoid it myself in any resizing situation (e.g., look for a custom tab control implementation). I don't know how hard it would be for you but you could test if this is the case by creating the contents of one of your tabs/panes within a dummy parent dialog or CWnd class instead. Add the similar OnSize() logic and see if you can reduce flickering on resize now that the tab control is out of the picture.
|
|
|
|
|
wxPoint point = GetPosition();<br />
HMENU pSysMenu = (HMENU )GetSystemMenu((HWND)this->GetHandle(), FALSE);<br />
if (pSysMenu != NULL)<br />
{<br />
int flag = TrackPopupMenu(pSysMenu, TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RETURNCMD, point.x+pt.x, point.y+pt.y, NULL, (HWND)this->GetHandle(), 0);<br />
if(flag > 0)<br />
SendMessage((HWND)this->GetHandle(), WM_SYSCOMMAND, flag, 0);<br />
}<br />
This wil display a system menu, but the problem is the system menu is not refreshed properly, whatever the previous one shown, when I click in the taskbar, is shown here also, and initally the maximize button is also enabled in the system menu shown by this way, whereas the maximize box is not in my frame. any idea....?
http://www.priyank.in/
|
|
|
|
|
I would like to accomplish the following:
If i pass my mouse over an edit box control on my application, i would like windows to display some text. Just like if you pass your mouse over a windows button, it describes the functionality etc.
Does anyone know how to do this?
|
|
|
|
|
|
Hmmmm!
How does the CToolTipClass work?
|
|
|
|
|
I would like to accomplish the following.
1. I would like some text in a record list to change color when i need to.
The text is "YES". I am inserting "YES" in the TEXT column using
SetItemText(i, TEXT, "YES") ;
Sometimes though, i would like to control the color. Like make it red
that that record has more importance. How would i accomplish this in MFC?
-- modified at 10:54 Friday 26th August, 2005
|
|
|
|
|
|
i'd like to get all ur advice for naming a Variable,Funtion, etc..etc..
for example,
how do you name a function like GET MACHINE STATE()
Is it nice to say like GetMachineState? or getMachineState() or getmachinestate() or GETMACHINESTATE()
AND FOR VARIABLES..
int eventCount; or EventCount; or eventcout;?
long C_value; or c_Value; or C_Value; ?
which one do u prefer? i've been messing up my program by not following a particular convention..
thanks ,
V
|
|
|
|
|