|
thanks for the reply
PostQuitMessage(0); does the job alright that i was looking for.
but for future reference i would still like to know how to pass variables between dialogs
say declare a int in "main" and pass it to "login" and "login" sends it back with a value inside it.
thanks
-- modified at 11:14 Friday 24th March, 2006
|
|
|
|
|
It depens on the type of dialog you are using. For non-modal dialogs you can send a message the same as you would send any other message, using SendMessage() specifying your own paramaters for lParam and wParam.
But with Modal dialogs, the main dialog is halted until the child dialog is closed. You are able to send a message from the child to the parent using PostMessage().
Another method is through the use of global pointers. I'm sure there are other methods, but the above 2 have always fulfilled my needs.
|
|
|
|
|
catch the return value like this :
CMainDlg::OnInitDialog() {
CDialog::OnInitDialog();
CLoginDlg dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDCANCEL) {
this->EndDialog(IDCANCEL);
}
return TRUE;
}
|
|
|
|
|
Does anyone know if it is possible for cold fusion to access a c++ dll.
I am specifically trying to use cold fusion to access a blowfish(encryption algorithm C++ dll).
1. Is it possible within the cold fusion framework
2. If so, can someone tell me or point me in the right direction?
|
|
|
|
|
Hello,
i need to get a Date object from one single data type, wich is a unsigned long, representing hundreds of seconds.
EFACEC.SE
Paulo RS Ferreira
|
|
|
|
|
see CTime[^] and CTimeSpan classes
|
|
|
|
|
Hello everybody,
A week ago or so I have posted a message with the same title. I have solved this problem. But now I ve got a new one. I do the following:
Start recording with the wave audio input device.
Using the function waveInStart()
During recording all waveheaders that are returned to the application are processed and added to the wave audio input device again.
Using the function waveInAddBuffer()
Driver messages are processed using a dedicated thread. (Using the flag CALLBACK_THREAD in the function waveInOpen)
After recording for a while the recording is stopped.
Using the function waveInStop()
Now I need to mark the last waveheader with a time stamp. Before I stop the wave audio input device I query the current sample
using the function waveInGetPosition() (All waveheaders are of the same size)
dwLastWaveHeader=(dwCurrentSample-1)/nSamplesInEachWaveHeader;
Oke this works. But in some very very rare cases the current data record is not returned to the application. (Happens when the current buffer is only filled for say 200 samples and less)
My question is how to make sure that the current buffer is returned to the application?
Thank you
|
|
|
|
|
waveInReset
The waveInReset function stops input on the given waveform-audio input device and resets the current position to zero. All pending buffers are marked as done and returned to the application.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hello Blake Miller,
Thank you for your reply!
I know that waveInReset returns all pending buffers to the application. But it returns all buffers with the dwBufferLength member marked to 0 on my system. Even the buffer that contains say 200 samples. (The buffer that was not returned using waveInStop) I am sorry but I don't think this would solve the problem. (I ve tryed it on my PC and on another PC)
Thank you
|
|
|
|
|
I'm writing a user interface with Visual C++ 6 on a computer with English as the working environment.
I have Chinese script that I can see in Excel and RTF files. It uses a SimSun font. I want the same script to appear on a button using SetTitle. I compile successfully with UNICODE defined. However, I can't figure out how to get the characters into the code. Any ideas?
ie wnd.SetTitle(_T("????"));
Mortie
|
|
|
|
|
I often have problems writing Chinese into my code using VC6, though for me each character takes up the space of 2. ie. the caret is able to position itself in the center of a character. It's annoying sometimes, especially when trying to edit the end of a line which has Chinese at the beginning.
A work around I often use is to write the function in notepad or something similar, then copy the whole thing over to MSVC.
I have just downloaded the 2005 edition, I hope this has been fixed.
|
|
|
|
|
You need to use escapes to put non-ASCII characters in source code. Figure out the Unicode code points of the characters, and do something like this:
wnd.SetTitle(L"\x341f\x98bc"));
(those are made-up values)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Cool.
Any hints on figuring out the code points. I could put the characters into a unicode configured text file, read the strings with a C++ program and print out the hex values. Is there an easier method or a utility available.
Mortie42
|
|
|
|
|
|
I must be close but...
Using your method (thanks), my hex values are \x62a4\x6797.
But I get empty boxes. When I use \x2021, I get the double dagger symbol.
My code is basically,
...
CFont font1;
font1.CreateFont(13,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,0,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|EF_DONTCARE,_T("SimSun") );
Button.SetFont(&font1, TRUE);
Button.SetTitle(_L"\x62a4\x6797");
...
What am I missing?
Mortie42
|
|
|
|
|
You need to set the charset parameter correctly. For Chinese, there two - CHINESEBIG5_CHARSET and GB2312_CHARSET . One is simplified, one is traditional, I can never remember which is which. :->
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Hmmm. I tried both. I compile w/o warnings But I still get two squares and a dagger with (L"\x62a4\x6797\x2021"); . Any ideas?
Mortie42
-- modified at 17:10 Friday 24th March, 2006
|
|
|
|
|
This works for me in a WTL dialog-based app
LRESULT CMainDlg::OnInitDialog(UINT , WPARAM , LPARAM , BOOL& )
{
CButton btn = GetDlgItem(IDOK);
m_font.CreateFont ( -13, 0, 0, 0, FW_NORMAL, false, false, false, CHINESEBIG5_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, _T("SimSun") );
btn.SetFont ( m_font );
btn.SetWindowText ( L"\x62a4\x6797" );
} The only change I made was the font size and char set params to CreateFont()
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I think I have issues else where.
I'm using an old copy of VisualC++6.0 on a new WinXP o/s.
I copied the DLL's for Chinese; APPWZCHS.DLL AND APPWZCHT.DLL from disc to machine. I tried making a simple MFC dialog application using these. The dialog box in VC showed one set of gibberish while on compilation and execution, the resulting dialog box had rows of ?'s. I'm taking a break for the weekend but before I go, could you tell me which version of VC and o/s you used?
Thx for all the help.
PS WTL is ...?
Mortie42
|
|
|
|
|
I'm using VC 6 on XP SP2. If you're on a fresh XP you probably don't have the east Asian language support installed. Control Panel-Regional and Language options-languages-Install files for east Asian languages.
WTL: clickety[^]
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Writing strings of Chinese in Hex format, urghh!!! It would be ok for very short items, but damn near impossible to read.
I am using VC6, with windowsXP SP1, and the MS MultiLingual User Interface (English and Chinese version installed as one). I have no real problems writing chinese text into my code (without using ascii), or displaying it in the application.
One point though, I never build Unicode, I always select MBCS. Try making a simple hello world app with a chinese string and play around with the settings until you get it right. If you have further problems I could give you a simple project to test.
|
|
|
|
|
Hi waldermort
please send me the project, I value any tips I can get.
mmortimer47 at hot mail dot com
Mortie42
|
|
|
|
|
Thx
I had assumed that because I could see the Chinese glyphs in Excel, word and Notepad that all was well. Bad me. With the East Asian Languages set the glyphs appear.
Mortie42
|
|
|
|
|
Use the String Table resource, don't put strings in code.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
hello,
Iam using CInplaceEdit class which I got from our own "codeproject".
This class adds an edit box into grid. Iam extending the feature by associating a spinbutton control with this edit box.
I have successfully done this.
But there are some problems which Iam unable to solve, which are as follows.
1) when the focus is in edit box and user pressess Up or Down arrow key in order to change the value of the buddy (edit box), the edit box looses focus and when user again clicks in the edit box & presses Up or Down arrow key the value of buddy changes & again edit box looses focus, & same process is repeated.
What is the solution to this.
2) when the grid column is resized it is showing many edit and spinner button control.
for more information Iam posting the code for creating a spinner button control:
BOOL CInPlaceEdit::ShowEditCtrl(DWORD dwStyle,
const RECT &rCellRect,
CWnd* pParentWnd,
UINT uiResourceID,
int iRowIndex,
int iColumnIndex,
CString& strValidChars,
CString& rstrCurSelection)
{
m_iRowIndex = iRowIndex;
m_iColumnIndex = iColumnIndex;
m_strValidChars = strValidChars;
m_strWindowText = rstrCurSelection;
m_bESC = FALSE;
if (NULL == m_pInPlaceEdit->m_hWnd)
{
BOOL bCreated = m_pInPlaceEdit->Create(dwStyle,rCellRect, pParentWnd, uiResourceID);
CRect rect;
rect.left = rCellRect.left + 50;
rect.top = rCellRect.top;
rect.right = 20;
rect.bottom = rCellRect.bottom;
bCreated = m_spinCtrl.Create(WS_CHILD | WS_VISIBLE | UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_ARROWKEYS |UDS_AUTOBUDDY
, rect, pParentWnd, IDC_SPIN);
m_spinCtrl.SetRange32(0, 1000);
UDACCEL uda;
uda.nInc = 20;
uda.nSec = 0;
m_spinCtrl.SetAccel(1, &uda);
m_spinCtrl.SetBuddy(m_pInPlaceEdit);
return bCreated;
}
return TRUE;
}
You need to comment(remove) following statement from "OnKillFocus" event handler of CInPlaceEdit class
//PostMessage(WM_CLOSE);
also one thing I observed that whenever u clicks on edit box Kill Focus event is generated is this the reason of edit box loosing focus??
Please help me.
I have almost achieved this but stuck b'coz of this minor(offcourse minor for u GURUS) problem.
|
|
|
|