|
Hi Christian,
Thanks for recent reply
Previously my Test2Dlg.h contained:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog,
{
// Construction
public:
I then changed it to:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog,
CTest2Dlg::CTest2Dlg() : m_hdlg(GetDesktopWindow)
{
// Construction
public:
I get the errors referenced to the line I added:
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
test2Dlg.cpp
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
Error 2059 seems to be a simple format/syntax error... can you tell me ??
Much thanks for your generous help,
Robert
|
|
|
|
|
Opps I put a typo in the 'Original' Code, an extra comma!
Corrected is below:
Previously my Test2Dlg.h contained:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog
{
// Construction
public:
I then changed it to:
/////////////////////////////////////////////////////////////////////////////
// CTest2Dlg dialog
class CTest2Dlg : public CDialog,
CTest2Dlg::CTest2Dlg() : m_hdlg(GetDesktopWindow)
{
// Construction
public:
I get the errors referenced to the line I added:
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
test2Dlg.cpp
e:\code\test2\test2\test2dlg.h(26) : error C2059: syntax error : 'declarator'
Error 2059 seems to be a simple format/syntax error... can you tell me ??
Much thanks for your generous help,
Robert
|
|
|
|
|
I think, as I said before, that you should not have this dialog as a member variable. The only reason to make it a member is if you want it to be modeless.
I have never tried to create a dialog as you are above, so I could be wrong in thinking the : syntax will work this way.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Have you looked at WinHelp or HTML Help?
|
|
|
|
|
how can i send a file from a client to a server and the other way around if i have a tcp connection between these two and the socket uses CAsyncSocket????
i can establish a connection and i can send text and stuff.
if i'd get the handle to a file and store the data in a BYTE maybe i could just use Send() on that BYTE or not?? what happens if its too big, dus the winsock divide it automatically or do i have to segment the BYTE??
Some help please
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
You cannot rely on CAsyncSocket::Send sending as much data as you provide it on a single call all at once. Please note that instead the function returns how many bytes it managed to swallow. Then you have to wait to the next invokation to your OnSend function, stuff the remaining bytes to the socket, and so on.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, All!!!
=======
Back in MS-Dos era to create a sound using the PC speaker we used sound() .
Is there anything like this in MS Windows 2000 ?
1 more thing:
* Can any of you guys throw me a bone about sound Inout and Output.
Thanks
P.S
* What is RIFF, PCM or something like that ?
Sagiv
|
|
|
|
|
i found that about the PCM :
Wav files can have a range of sample rates and different sample types. Without going into the technical detail, PCM is the purest audio format, and offers much better sound quality than other compressed formats such as ADPCM or Real Audio. The downside is that file sizes are large. A high sample rate provides better quality audio but has a much larger file size. Similarly, 16 bit PCM gives less hiss but has a file size double that of 8 bit PCM. As a general rule, you will not viably be able to embed an autostart file which is longer than 10 seconds. To have longer recordings you will need to use Real Audio or mp3 (see below).
have a look there for more details : http://www.world-voices.com/resources/addaud.html
Fred
|
|
|
|
|
Beep() to make a sound, PlaySound() to play a wave, and DirectSound to get the whole input/output thing happening nicely. I believe there is a CP article on recording sound not using DX, but I'm not familiar with how it is done.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
here some more info about the audio formats
WAVE - this was the most common audio file format on Windows-based systems. It was derived from the RIFF format and is a close cousin to the Audio Video Interchange (AVI) format for audio and video. A complete technical description of this format can be found at http://www-ccrma.stanford.edu/CCRMA/Courses/422/projects/WaveFormat/.
have a look there for the complete report : http://www.cs.ucf.edu/~moshell/CAP4020/lecture28.html
Fred
|
|
|
|
|
I'm having alot of difficulty converting a CString to a double.
Can anyone help me with this problem. I have something that needs to be done VERY soon =).
Thanks in advance!
-- Kelthar :: icq9071676 :: http://uteliggare.net/southern/ --
|
|
|
|
|
|
#include "stdlib.h" // atof()
#include "math.h" // atof()
...
{
CString myData;
double result;
...
result = atof(myData);
...
}
|
|
|
|
|
Great! Thanks!
I'm just wondering how to turn it back to a CString.
The problem is that ecvt etc asks me for decimal pos
and i honestly have no clue what so ever.
(this is the last one =)
-- Kelthar :: icq9071676 :: http://uteliggare.net/southern/ --
|
|
|
|
|
How about:
double vdblValue = 18563.2648929;
CString vcstrTemp;
vcstrTemp.Format(_T("%.2f"), vdblValue);
The %.2f format specifier is described in MSDN, but basically it'll print a floating point value with 2 digits after the decimal point. I think that just putting %f will use the default precision of 6 digits.
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Hey all
Is there anyway of returning only monospaced fonts, like Courier...?
I have seen code to return TRUETYPE, RASTER and DEVICE, but not MONO and was curious if this is even possible...?
Can MONO spaced fonts also be TRUTYPE, like Courier New...is this both...?
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
You can determine if a given font is monospaced by looking at the TMPF_FIXED_PITCH bit inside member tmPitchAndFamily of structure TEXTMETRIC . This structure is provided to the callback proc of EnumFontFamiliesEx and similar functions, and can also be explicitly obtained with GetTextMetrics (the documentation on this function explains how).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
hi all,
for this project i need to display a picture on the background and few icons + txt at different positions on the screen.
it's like the background picture is part of layer #0, the icons part of layer #1, the txt part of #2 and so on.
like this, it would be possible to display only the picture (layer#0) or the picture and icons (layers#0 + #1) ...
does anybody has any idea how to do it ?
regards,
Fred
|
|
|
|
|
There's a lot of ways to handle this situation, depending on your specific requirements. If you are developing a dialog-based app (I'm assuming you use MFC), then a possibility (by no means the only one) is that you paint the background picture as the dialog background (see this post of mine that explains how to do it), and the icons and texts you can create them dynamically as CButton s and CStatic s, respectively, having your dialog as their parent window. Then, depending on the layers you want to depict, you just have to show/hide the controls (you can store pointers to it on some arrays, one for each layer) with ShowWindow .
Sorry for this vague explanation, but maybe it's enough to put you on the right track. Good luck.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Draw the background in OnEraseBackground and then put the items in the layers into an array. In OnPaint, draw only the items in layers flagged as being visible.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hi,
I want to change dialog form in a CFormView.
I can change the dialogs, but when I click on the second dialog for example, if the mouse is over a control of the first form, this control appears.
How can I disable the controls on the other dialogs form.
The method ShowWindow(SW_HIDE)doesn't work as DestroyWindow and as EnableWindow.
Anybody has hints ???
Thanks,
Claude
void CPoteauView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
CPoteauDoc* pDoc = GetDocument();
CDialog* m_viewDial[3];
m_viewDial[0] = new CEnter;
m_viewDial[1] = new CDeux;
m_viewDial[2] = new CTroisDia;
m_viewDial[0]->Create(IDD_DIALOG1, this);
m_viewDial[1]->Create(IDD_DIALOG2, this);
m_viewDial[2]->Create(IDD_DIALOG3, this);
if (pDoc->m_nView == 0)
{
m_viewDial[0]->ShowWindow(SW_SHOW);
m_viewDial[1]->ShowWindow(SW_HIDE);
m_viewDial[2]->ShowWindow(SW_HIDE);
}
if (pDoc->m_nView == 1)
{
m_viewDial[0]->ShowWindow(SW_HIDE);
m_viewDial[1]->ShowWindow(SW_SHOW);
m_viewDial[2]->ShowWindow(SW_HIDE);
}
if (pDoc->m_nView == 2)
{
m_viewDial[0]->ShowWindow(SW_HIDE);
m_viewDial[1]->ShowWindow(SW_HIDE);
m_viewDial[2]->ShowWindow(SW_SHOW);
}
}
Claude
|
|
|
|
|
You need to use something like this. This code was from a splitter windows app so ignore some of it
<br />
CCreateContext context;<br />
<br />
context.m_pNewDocTemplate = NULL;<br />
context.m_pLastView = NULL;<br />
context.m_pCurrentFrame = NULL;<br />
<br />
switch( iNewView )<br />
{<br />
case ENTER:<br />
context.m_pNewViewClass = RUNTIME_CLASS(CEnter);<br />
break;<br />
case DEUX:<br />
context.m_pNewViewClass = RUNTIME_CLASS(CDeux);<br />
break;<br />
case TROIS:<br />
context.m_pNewViewClass = RUNTIME_CLASS(CTroisDia);<br />
break;<br />
default:<br />
return;<br />
}<br />
<br />
m_uActiveView = iNewView;<br />
<br />
CDocument* pDoc = GetActiveDocument();<br />
context.m_pCurrentDoc = pDoc;<br />
<br />
CView* pActiveView = (CView*)m_wndSplitter.GetActivePane();<br />
CRect rectWnd;<br />
pActiveView->GetClientRect( &rectWnd );<br />
<br />
pDoc->m_bAutoDelete=FALSE; <br />
(m_wndSplitter.GetPane(0,1))->DestroyWindow();<br />
pDoc->m_bAutoDelete=TRUE;<br />
<br />
m_wndSplitter.CreateView(0, 1, context.m_pNewViewClass, rectWnd.Size(), &context);<br />
<br />
CFormView* pNewView = (CFormView *)m_wndSplitter.GetPane(0, 1);<br />
pNewView->SetOwner(this);<br />
pNewView->OnInitialUpdate();<br />
SetActiveView(pNewView);<br />
<br />
m_wndSplitter.RecalcLayout(); <br />
|
|
|
|
|
|
Hi all,
I made two dialogs (MainDialog - SubDialog)
I loaded SubDialog from MainDialog::OnInitialDialog by DoModal ...
when i close the subdialog and then close maindialog(closing program), and i see subdialog again after closing program, for a minute !!!
WHY ????
HOW CAN I SOLVE THAT ????
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Well, I don't see that your problem has to do with SQL. Nevertheless, the behavior you describe shouldn't be happening. Maybe you can do a global search on your project files for DoModal to see if you're creating the subdialog twice and forgot about it. Apart from this, if you could post some code that'd help us help you.
Regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|