|
|
Thanks for the info!
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
I assume you want to quit the current dialog and bring
the existing dialog to the foreground.
SetForegroundWindow is the right call, but its behavior
in later versions of Windows will thwart you (it just
flashes the item on the taskbar) unless you jump the
right hoops: AttachThreadInput
Here's a great article :
http://www.etree.com/tech/Articles/attachthreadinput.pdf
And here's some code to do it:
DWORD MyThreadId=GetCurrentThreadId();
DWORD ForeThreadId=::GetWindowThreadProcessId(::GetForegroundWindow(),0);
HWND hForegroundMe=0;
// Get handle to the window you want to place in the foreground.
// For instance use EnumThreadWindows if you know the ThreadId
// (perhaps you have it saved in a shared memory?)
// or use EnumWindows if you know the window text of the window
// you are looking for...
if (GetWindowLong(hForegroundMe,GWL_STYLE)&WS_MINIMIZE)
::ShowWindow(hForegroundMe,SW_RESTORE),::UpdateWindow(hForegroundMe);
if (ForeThreadId!=MyThreadId)
AttachThreadInput(ForeThreadId,MyThreadId,TRUE);
::SetForegroundWindow(hForegroundMe);
if (ForeThreadId!=MyThreadId)
AttachThreadInput(ForeThreadId,MyThreadId,FALSE);
|
|
|
|
|
Hi, i'm dealing with a form with about 250 objects, now i cannot insert any other objects. Is there a limit for objects in a form, can i solve by code?
Thank you
|
|
|
|
|
Do all the objects need to be on the same form, or just all be displayed?
You could use property pages to split up the objects, and then display multiple property pages
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
If I recall, there is an artificial limit of around 255 controls per window. It may be OS based or editor based. Just can't remember.
As Benjymous said, splitting up the controls onto sub-pages may be the best way to go.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Well, i'm kind of new with Visual C++, i understand the function of DoDataExchange, i read a bit about DDP in MDSN, i understand the concept but i'm sure that i know how to use it, can you give me a example?
Most of my objects are used with an array, and for this form i don't have a ClassWizard, i've got a parse error when i try to call it, but the aplication works.
Thank you all
|
|
|
|
|
Classwizard doesn't like anything unexpecetd inside the DDX AFX_DATA_MAP(...) comments. If you want to use array items, just move them outside the comment block and classwizard should be happy.
If your using DDX, it would recommend sticking to control variables and not CString's etc using UpdateData() as it gives you much more control. But thats just my personal preference.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
ClassWizard is very happy now, about the variable type, i'm using, for the same object both control and text variables and i hope this is not the cause of my problem.
About DDP, is there a easy way to use it? Oor good articles about?
Thanks
|
|
|
|
|
What's the difference between #include <something> and #include "something" ?
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"But everybody darlin' sometimes bites the hand that feeds."
"Remember in this game we call life that no one said it's fair."
"Just because you're winnin' don't mean you're the lucky ones."
Song: Breakdown - Album: Use Your Illusion II - Artist: Guns N' Roses
|
|
|
|
|
#include "something" tells the compiler to look in the the source folders for your project. Use this for including your own source files.
#include <something> tells it to search the system include file paths (for including system things)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Yep, and you'd be suprised how many open source/unix projects get this wrong. They either use all #include <>'s or all #include ""'s. Makes one feel safe using open source programs.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|
|
Well done for asking your stupid question. So now its my turn is it?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
When I debug my program,in the output window,it display message:
"First-chance exception in Diary.exe (KERNEL32.DLL): 0x000006B5: (no name)."
I don't how to stop the program when the error occured.
In my program ,if the following code was executed ,it would display the error message.The code is:
char szFileFilter[]=
"Mp3 File(*.mp3)|*.mp3|"
"Mid File(*.mid;*,rmi)|*.mid;*.rmi||";
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,szFileFilter,NULL);
if(dlg.DoModal ()==IDOK)
{
m_MusicPlayer.SetAutoStart (TRUE);
m_MusicPlayer.SetFileName (dlg.GetPathName ());
}
please tell me how to stop the program when the "first exception' error occured,thank you!
By the way,in my program ,I use Active Movie OCX to play MP3 file,but to my surprise,if start the program in the vc6
IDE with key 'F5',it will automatically quit when I want to play MP3,(that is ,the above code was executed).But if I start the program in explorer,it work well.
I can't solve the problem,hope you help!
Thank you very much for all your help!
Don't look at me in that way!
|
|
|
|
|
start your program, then go to VCs Debug menu, choose Exceptions. in this dialog you can choose how VC responds to exceptions.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
We´ve been developing an app in win2000 using MFC. When we try to run it on win98 we get a debug assertion failure when we try to execute this line: CFormView::OnInitialUpdate(). The dialog says that the error is in dlgdata.cpp on line 43. Does anybody know why this error occurs.
|
|
|
|
|
Hi Gang,
I'm just looking for a control that simulates the "Properties" settings similar to what VB has for their controls. Left side is the tag, right side is the description.
But, you can group the items together or show them alphabetized. I'd also like to know if there are some that have an ability to limit the number of characters a user may type in.
Thanks for the locations!
|
|
|
|
|
I'm new using Visual Studio, but I have done work before using C++ on Unix based systems. Is there a site that I can go to that can give me a run through on how to write out to a database? Or even just and over all guide on how to use the visual end and database connectivity? I was able to pick my datasource and my tables and everything, but i don't know how to access or write to them. And for an added bonus the visual studio I have, is missing it's help files.
Any help will be great. I love the faces on here.
ICXC
NIKA
|
|
|
|
|
You can execute SQL commands...like this
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" no_namespace rename("EOF", "EndOfFile")
_bstr_t strConn("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=yourdatabase.mdb");
_ConnectionPtr pCn("ADODB.Connection");
kl.Format("INSERT INTO ...);
pCn->Open(strConn, "", "", adConnectUnspecified);
pCn->Execute((_bstr_t)kl ,NULL, adCmdText);
pCn->Close();
i hope this helps
|
|
|
|
|
any idea how I could run a sybase stored procedure from there? for example. I have an array for names. names[]. I want to pass the array into a sybase stored procedure within my database called storenames. any idea on how I could do that?
ICXC
NIKA
|
|
|
|
|
You could always use ODBC. There are many simple wrapper classes that make it very painless to do. I have been using a set of ODBC wrappers for many years now and have had no problems with sybase, oracle, MSSQL, Access, etc. Additionally, if you are just executing statements/sprocs and using fwd only result set fetching, odbc is a little faster than using ATL/OLEDB. If you need wrapper classes, send me an email and I can set you up.
|
|
|
|
|
I am trying to use a property page inside of a few different dialogs.. but i can't get it to show up.. if i take my property page and use it with CSAPrefsDialog (a netscape style options dialog on CP) it shows up.. but in my dialog all i see is the black frame of the static control.. heres what i have:
BOOL MyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_boundingFrame.GetWindowRect(m_frameRect);
ScreenToClient(m_frameRect);
CMyChooser Chooser;
if (!::IsWindow(Chooser.m_hWnd))
Chooser.Create(IDD_MYCHOOSER, this);
if (::IsWindow(Chooser.m_hWnd))
{
Chooser.MoveWindow(m_frameRect.left, m_frameRect.top, m_frameRect.Width(), m_frameRect.Height());
Chooser.ShowWindow(SW_SHOW);
Chooser.SetFocus();
Invalidate();
RedrawWindow();
}
return TRUE;
} I've tried returning FALSE, and I've traced through, everything gets called, but nothing shows up.. my static frame has everything set to false except 'Visible' (which ive tried false as well), and has Type set to 'Frame'.
basicly i just want to be able to place this property sheet(MyChooser) into several different dialogs.. but i cant get it to show up anywhere.. anyone know why?
thanks!
-dz
|
|
|
|
|
CMyChooser is being declared locally on the atck. It goes out of scope at the end of the procedure, which probably destroys all the windows you have created. Make is a member variable of the MyDialog class as a 1st step.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
thanks a ton!
ya.. im still learning..
-dz
|
|
|
|
|
I have placed CPropertyPage(s) on a CPropertSheet (using the CPropertySheet member function AddPage() and then called the DoModal() member function of the CPropertySheet to do this sort of thing.
I have some notes on my method... if you haven't solved this one yet let me know.
|
|
|
|