|
When you say "the" rect, which rect do you mean ? Could you post your code ? I think you are mistaking GetClientRect() with GetWindowRect() . One of both returns you the size of the window defined in the ressource editor, the other one the "present" size of your window. So if you´re not using the good one, the window size may actually change while running your app but you are still asking for the original size in the ressource editor which remains of course unchanged. See what I mean ?
~RaGE();
|
|
|
|
|
I am using GetWindowRect(), but I also tried get client rect, and this resulted in the window being moved outside the main window that was creating the dialog box that contained the ActiveMovie Control, and it still gave me the wrong rect. Thanks for your help though...Any other suggestions?
|
|
|
|
|
Just post your code, pls...
~RaGE();
|
|
|
|
|
here it is:
video->Create(0,"hi",WS_VISIBLE|WS_CHILD,CRect (0,0,500,500),this,10);
video->SetFileName(opendlg.GetFileName());
video->Run();
//Resize dialog box to hold the movie window
video->GetWindowRect(avidlg.newrect);
avidlg.MoveWindow(avidlg.newrect, TRUE);
avidlg.UpdateWindow();
|
|
|
|
|
To be honest, i do not see what´s wrong, sorry ... Ain´t it any MovieWindowSize() function like specified in MSDN ??
~RaGE();
|
|
|
|
|
Ah, thanks for your help anyway. We couldn't find anything wrong with it either. There is a MovieWindowSize() function, but it only takes a long as a parameter, 0 1 2 or 3. This doesn't seem to limit the size of the video to a point where I can get a decent resize factor. Anyway, thanks for giving it a shot. If you come up with anything else, let me know. Thanks.
|
|
|
|
|
Is it possible to draw a window directly on the memory dc as we are drawing on the screen.
|
|
|
|
|
Does anyone knows how to use FilgraphManager Object(directx object) in VC?
Thanks a lot.
No pains, no gains.
|
|
|
|
|
Hi,
I need to parse a small amount of code. The best way to do this is probably to create a parser but I don't like the idea of writing a parser from scratch. Besides, there are a number of parser generators out there which should be able to create a parser that does all I need.
But what parser generator should I use? I downloaded the spirit parser generator but haven't tried it out yet.
I'm using C++ but the code I have to parse is actually VBA. Not that it matters much - the code is not very complicated and uses only a small subset of the VB language.
Any comments would be appreciated.
With best regards,
Daniel
|
|
|
|
|
You could try Antlr..or (if you're more masochistic) Lex&Yacc or Flex&Bison. I've also used Visual Parse++ (that costs money, though), but I'd give Antlr the prize for most intuitive specification language - it also generates easy to understand & debug code, mainly because it generates a recursive descent parser rather than one based on an FSM.
Like you, I've downloaded Spirit, but not tried it out...
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
I there something similar as flock() on Unix machines?
I'd like to get exclusive file access or shared read access. Thanks for help.
|
|
|
|
|
|
thanks.
How can I use them together with old libc/CRT funtions fopen() , flose() ? Or which would be the best functions to lock files when using fopen etc?
|
|
|
|
|
It would be better to use CreateFile and lock it by passing 0 as the share mode.
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
The problem is portability here.
Right now my core code works on Windows, Unix, whatever. I'd like to keep that, once you have it it's neat to have it. perhaps there is a workaround, to still work with fopen()?
|
|
|
|
|
How can you talk about portability if you are using Unix's flock()? I doubt this function is in the ANSI standard.
Best regards,
Alexandru Savescu
|
|
|
|
|
oh... good point. sorry, didn't want to say that Unix way good, Windows bad.
Let me ask for a portable way - or - a way to do file access locking on Windows when using fopen()? Thanks in advance.
|
|
|
|
|
You may do this:
#ifdef WIN32
#else
#endif
Best regards,
Alexandru Savescu
|
|
|
|
|
May I ask for an short example how I use CreateFile together with fopen?
|
|
|
|
|
Hi,
I am using Visual C++ version 6.0 and am having an interesting compiler bug. Maybe someone has experienced this before. I also have Service Pack 5.0 (Is it the most recent?) installed, but does not help.
I have declared a variable in CMainFrame. This variable is of the type CMyClass.
When I compile my code, the compiler complains about the variable I have declared. What I do next is to comment out the variable I have declared and re-compile. The compiler then complains about lines of code using the now commented out variables.
The next step is to re-declare the variables previously commented out and re-compile. And voila, the compiler now has no errors. It is then possible to run my application and it works fine.
The problem I now have is that I would like to compile the code in Release Mode. But the above-mentioned trick does not work now.
This is because the compiler compiles all files in Release mode whenever a change is made and not only changed files as in Debug mode.
So, my question now is: Has anyone seen this before and do they have a solution?
Thanks
Regards
Rui
Rui
|
|
|
|
|
Ruca wrote:
So, my question now is: Has anyone seen this before and do they have a solution?
I had it yesterday, and a clear/rebuild all solved the problem, in Release Mode. I´ve already observed that this kind of situation comes up every now and then when using own defined classes object, such as CMyClass MyObject .
A few other tricks to solve extraterrestrial compiler bugs:
- Be careful not to have included files which are not in the file browser (solution: delete the
#include or add the corresponding files with Add Files to Project) - Watch if you are not making changes to a file which as the same name as a file which is in your project, but which is actually in another directory
...
~RaGE();
|
|
|
|
|
I had once a stranger bug. The compiler generated different code depending on some comments placed at different positions (the same comments, not different piece of code commented) and that difference influenced a bug.
Most of the times a rebuild and a restart fixes problem. Also, if the same thing happens when compiled on 2 different machines then there is a problem with your code, if not it's the compiler.
Best regards,
Alexandru Savescu
|
|
|
|
|
Thanks for your comments Alexpro and Rage. You gave me the determination to solve the problem. I definitely thought it was a compiler bug, which I did not care too much about because I could get around it. But when I tried to compile in Release Mode, the workaround did not work anymore.
After reading your comments I started to try new things and found that I had a circular include, i.e. I included file A in B and B in A (although not as simple as that). After sorting this out, the problem was resolved.
Thanks once again
Regards
Rui
|
|
|
|
|
Hi,
I have a property sheet, from one ATL control, when the user presses enter the property sheet is closed ( ), I need to handle the enter key to do other operation ( and of course avoid closing the Property sheet), How can I skip the Enter key for the property sheet? ( in ATL there is no Pretranslatemessage... ).
Thanks in advance, Greetings
Braulio
|
|
|
|
|
Hello, folks,
I got some trouble on sorting items in my CListCtrl. That is, I have a list control (i.e, of type CListCtrl), and this list control has 4 columns.
I want to sort the items on this list control by a given column (i.e, clicking the column header on the GUI of this list control.)Now, I found some sample codes from MSDN but I don't understand. I posted the MSDN sample as follows.
My question is: where and how to pass the 2 parameters (lParam1 and lParam2) to the callback function ?
Because I don't know the sample code has something to do with passing 2 parameters (lparam1 and lparam2) to the callback function (MyCompareProc).
And, this MyCompareProc callback function just compares 2 items ? If my list control has more than 2 items, what is the mechanism about this compare function ? And how can I use this callback function to sort many many items in my list control ?
Thanks for your help ! Any response would be greatly appreciated !
Example
// Sort the item in reverse alphabetical order.
static int CALLBACK
MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
// lParamSort contains a pointer to the list view control.
// The lParam of an item is just its index.
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;
CString strItem1 = pListCtrl->GetItemText(lParam1, 0);
CString strItem2 = pListCtrl->GetItemText(lParam2, 0);
return strcmp(strItem2, strItem1);
}
void snip_CListCtrl_SortItems()
{
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
// Sort the list view items using my callback procedure.
pmyListCtrl->SortItems(MyCompareProc, (LPARAM) pmyListCtrl);
}
|
|
|
|