|
pObject points to your class, you just have to type cast it.
CLogViewFrame *pLogViewFrame = dynamic_cast<CLogViewFrame *>(pObject);
ASSERT (pLogViewFrame); Untested code.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Cooooooolllllllll !!!
thanks !
|
|
|
|
|
Hi,
I have a VB ActiveX DLL, how can I add it to my VC++ project?
Its very easy in the 6.0 version, but I have trouble with .NET !!
Ehsan Behboudi
|
|
|
|
|
Hi,
Whe I used my CListBox on a dialog and wanted to scroll it programatically, I used:
<br />
list_box.SetAnchorIndex (pivot+18);
list_box.SetSel (pivot-1);<br />
<br />
<br />
But when I used CListBox as a view inside a CFrameWnd it does not work anymore, it always shows the selected line at the top.
???????????/
Shay
|
|
|
|
|
OK OK
I found it alone,
Apperantly the SetSel, scroll the view back to the top.
So what I did was to swap between the commands and now it all works
Good for me
|
|
|
|
|
God, I'm hoping some of you can help me here. I need DIRECTION.
I want to create a .NET application. I want to use C# language since it seems good for rapid application development.
I want to create the user interface (GUI) using the Visual Studio IDE form design.
Tell me if the following is possible:
I want to use DirectShow AND the Microsoft Speech .NET SDK in the SAME application. How can I do this? All the DirectShow examples are written in C++. All the .NET speech examples are written in C#.
Can I write the bulk of my application in C# and use C++ only for the DirectShow portion of it? Is this possible too?
Also, I'd like to "skin" my application, or in the very least give it some "personality" with rounded buttons and some custom controls that I create myself. Can I still use the Win32 API and "layered" windows to skin a GUI created with the "forms" wizard in Visual Studio? Is there any other way of creating that "custom" look?
I'm new to this stuff and I'm really confused. What's worse, is that I read all kinds of stuff about "managed code" and how DirectShow does not use managed code... DirectShow is built upon COM objects.... .NET allows one to mix managed and unmanaged code in the same application.... blah blah blah.... HELP!!!
All I want is some direction and advice on what to do 1st, 2nd, 3rd... I just don't know where to start... I don't want to read a 400 page book on ATL and COM if I'll be using C# which hides the COM internals... you know what I mean? HELP!!!
|
|
|
|
|
Brian JR wrote:
I just don't know where to start
A possible alternative to using DirectShow may be to use the Windows MediaPlayer ActiveX control, which may simplify the development process, but assumes all you want is fairly standard playback. If you do need to use DirectShow, start with the SDK samples, try playwnd for playback of a file. From personal experience, DirectX programming and DirectShow in particular takes a while to get used to - if you've got the time to spend learning it or after testing you know you need better performance, it's brilliant, otherwise look for a quicker solution.
Brian JR wrote:
I'd like to "skin" my application
Keep in mind that the "custom look" and "skinning" are quite different areas to DirectShow - many articles on CP can help you in this area.
Brian JR wrote:
I read all kinds of stuff about "managed code"
I haven't played much with managed extensions, but that board may be a more appropriate place to ask that question. MSDN mentions the Microsoft.DirectX.AudioVideoPlayback namespace, and there seems to be stuff for C# available.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.audiovideoplayback.asp[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Thanks for the advice. I appreciate it.
Still doesn't seem that I'm further ahead than before. All the examples I've seen so far use the Win32 API to generate a GUI for DirectShow - this is not what I want. Since I'm starting out, I'd like to pick the "right" GUI platform, or perhaps something a bit easier to use. I like the "forms wizard" in C# in Visual Studio 2003. I want to stay away from MFC and WTL, if I can.
What does "CP" stand for?
Do you think it's possible to write the application in C#, use the C# forms wizard for the GUI, and wrap all the DirectShow stuff into managed code?
Seems like this is going to be a bigger challenge than I originally thought.
|
|
|
|
|
Brian JR wrote:
What does "CP" stand for?
CodeProject.
BTW, you can use unmanaged API's from C# just as easily as from C++.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
thanks.... think I'm getting closer to my answers... thank God for the internet... and these forums...
|
|
|
|
|
OK. I found this type library for DirectShow: Seems like no one else has taken this approach in all the articles I've read so far. Do you know why?
http://www.kohsuke.org/dotnet/directshowTypelib/
Does this type library solve my problem of working with DirectShow in .NET? So I can use this type library to do MC++ and C# programming?
Brian
|
|
|
|
|
Anyone know how to detect whether the user has large fonts in Windows XP? I use the following code in 2000, but it doesn't work at all in XP:
float ItemTemplate::getFontProportion()
{
static int normalSize = 96;
int size = 96;
HWND window = ::GetDesktopWindow();
if(window)
{
HDC dc = ::GetWindowDC(window);
if(dc)
size = ::GetDeviceCaps(dc, LOGPIXELSX);
::ReleaseDC(window, dc);
}
return size / (float)normalSize;
}
"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
|
|
|
|
|
Hello, I am new to C# and ASP.NET, I have previously used ASP.
Inside my C# codebehind file, I open a database and get out
information. Now depending on that information I would either go to
the start page or show a text box and button for more information.
How do I move to another page without the action="page.aspx"
attribute? How do I pass information from C# like the user name to
C++ inwhich is using a HtmlView?
|
|
|
|
|
Hi,
I have an app that has a few modeless windows....I have a menu that allows the user to bring up a couple of these windows individually. My problem is that one window has an options that when selected brings up one of the previous windows. I want it to set the focus to the opened window instead of creating a duplicate. I thought i had a solution but it doesn't work.
Can someone help me please? THANKS in advance.
Here is my code. I thought this code would work but it doesn't.
if (m_pStats== NULL)
{
m_pStats= new CStats;
if (m_pStats->Create(IDD_STATS) == TRUE)
m_pStats->ShowWindow(SW_SHOW);
}
else
m_pStats->SetActiveWindow();
|
|
|
|
|
If your modeless dialogs are bell behaved, then they auto-delete in PostNcDestroy . The problem is that m_pStats will be non-NULL even after the window it formerly pointed to has gone into oblivion. You can try the following approach. Define a CStats ** member into CStats just like this:
class CStats
{
...
CStats ** m_myself;
}; After calling new CStats and before Create use m_myself to let the window know about the variable pointing to it:
if (m_pStats== NULL){
m_pStats= new CStats;
m_pStats->m_myself=&m_pStats;
... Now, in PostNcDestroy you can take advantage of this variable to set m_pStats to NULL :
Void CStats::PostNcDestroy()
{
*m_myself=NULL;
delete this;
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
While Joaquin brings I up a very good point I have a different suggestion. Instead of m_pStats->SetActiveWindow() try m_pStats->BringWindowToTop() and then m_pStats->SetFocus().
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni,
This does not do anything different from what I had. Do you have any other ideas....it is beginning to drive me crazy to have all these duplicate screens.
Thanks again for your help
|
|
|
|
|
Jay Hova wrote:
Do you have any other ideas
Unfortunately, I don't. Sorry!
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hi,
First off, thanks for the suggestions and help.
I tried both and they did not work for what I want. Maybe I should explain better.
I have one window called stats and one window called config. Each having their own menu option to display them. If I constantly use the menu item to bring up stats it works fine with the code I wrote, continuously setting focus to the opened window instead of creating a new one.
My problem is when i bring up the config window. When "ok" is hit on my config window it should open the stat window if it is closed or just set focus to it. No matter if i display the stats window and the bring up the config window, or if i just repeatedly bring up the config window it will continue to make new instances of the stats window everytime config is brought up.
Can someone help me solve this problem so that only one stats window is displayed no matter how i use the menu?
THANKS IN ADVANCE!
Any help would be appreciated, this is beginning to drive me nuts.
|
|
|
|
|
Try this:
if( IsWindow( m_pStats.m_hWnd ) == FALSE )
{
}
else
{
}
|
|
|
|
|
Hi
I have a CEdit control that I am trying to have multilined. I am reading a file into a char array buffer:
<br />
char buffer[1000];<br />
<br />
CClass->Read(Buffer, length);<br />
My question is that when I have the edit box display the buffer it is not displaying it correctly. Instead of carriage returns I am getting 'square' boxes. I moved the buffer into a CString, but its not picking up the CRLF. How do I go about doing this? Do I have to search and replace? Or, is there a CString method that easily fixes the CRLF problem I am having. I tried using the character array and a type-casted CString variable but I keep getting the same problem. The class I am using is CHttpFile and its read method.
TIA for any help or insight you can give into this matter.
|
|
|
|
|
Post an example of the string in Buffer including the code for the carriage return.
Kuphryn
|
|
|
|
|
try \r instead of \n in your code
|
|
|
|
|
Sorry should have been more clear but thanks for the fast response. I am not adding the '\r\n' or anything into the code, it is how it is getting read into the buffer from the member function. I'll post an example when I get home from the code I have but basically its:
Create CInternetSession and CHttpFile, send request, and then the read member function from CHttpFile. Then I just call
<br />
SetDlgItemText(IDC_EDIT, strBuff);<br />
Where strBuff is a CString that has been created using the character array CString strBuff(Buffer); I know its redundant but I did this to see if CString would handle the carriage return better but its not
|
|
|
|
|
Well then,
Once again, on the same string you send to the edit box, try :
strBuff.Remove ('\r');
See if that will work.
|
|
|
|