|
Theoretically at least, std::string::max_size() is such value.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
You can call max_size function to check this. On my computer this function returns maximum value for UINT type.
|
|
|
|
|
What's a good book for building multithreaded applications in windows specifically and C++ generally?
i came across this book "Object-Oriented Multithreading Using C++
Author: Cameron Hughes, Tracey Hughes "..is this worth it? or is there any other ones out there that could be better?
thanks
|
|
|
|
|
Check out www.amazon.com. They usually have book review by its readers and have references to other similar books.
|
|
|
|
|
Does anybody know how to navigate the controls which over a TabControl by TAB key? I can tab on tab header most but never tabbing through the controls over it. I created main dialog, tab pages dialogs and main dialog with a resource editor. Looking well and can successfully change pages, nice working but... What is the magic codes for solution? (if possible with only api codes. But suppose,if possible, not much diferent)
Note: all controls and SysTabControl32 also has WS_TABSTOP style. But in fact I didnn't saw any example that can do this(CodeGuru, CodeProject) except one but that was a PropertySheet inherited ownerdrawn tab cotrol, this means any but why?
|
|
|
|
|
any idea? please...anybody did? hard?
|
|
|
|
|
Hi there,
I loaded a bitmap file in a HDC ...
Now, i want to get a copy of the HDC to another HDC variable !!!
How could i do it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I think you mean you want to create another HDC, another HBITMAP, and copy the one bitmap to the other.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I need to connect to some BODY object events as soon as possible. WHEN I must do it, check BODY availability by timer? Events like OnDonloadComplete comes too later...
|
|
|
|
|
I want my program to have the option of starting automatically at system start-up. How can I have the program add and remove the necessary shortcut from the Start Menu's startup folder?
|
|
|
|
|
You can use the IShellLink interface to place a shortcut in the startup folder, or you can use the registry, and place an entry to your app in the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run Key.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
|
I have a tree control and WM_MOUSEMOVE is never sent when the mouse is over the tree control. Is there a way I can get it to recieve the message?
-Raffi
|
|
|
|
|
Derive a class from your CTreeCtrl, and handle the WM_MOUSEMOVE in this class.
~RaGE();
|
|
|
|
|
Hi
I'm using this code to insert items into my CComboBoxEx with icons:
BOOL CConfigDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_Images.Create(IDB_ICONS, 16, 1, RGB (0, 128, 128));
m_ctlCombo.SetImageList(&m_Images);
for(int j=0; j<8; j++)
{
CString string;
string.Format (_T ("Item %d"), j);
COMBOBOXEXITEM cbei;
cbei.mask = CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_TEXT;
cbei.iItem = j;
cbei.pszText = (LPTSTR) (LPCTSTR)string;
cbei.iImage = j;
cbei.iSelectedImage = j;
m_ctlCombo.InsertItem(&cbei);
}
return TRUE;
}
But for some reason my Combobox remains empty. Does anybody know why?
thanks in advance
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That code looks correct to me, but there are a couple of other things I can think of:
- Is the m_ctlCombo variable hooked up to the actual control properly? Is there a DDX_Control call for it in the CConfigDlg::DoDataExchange method?
- Is the control on the dialog resource actually a ComboBoxEx, or is it only a standard ComboBox?
As a very minor point, I don't like the (LPTSTR)(LPCTSTR)string cast, because I tend to think it's bad practice to cast away the const . How about:
cbei.pszText=string.GetBuffer(0);
...
m_ctlCombo.InsertItem(&cbei);
string.ReleaseBuffer();
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Mike Upton wrote:
Is the m_ctlCombo variable hooked up to the actual control properly? Is there a DDX_Control call for it in the CConfigDlg::DoDataExchange method?
void CConfigDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO, m_ctlCombo);
...
Mike Upton wrote:
Is the control on the dialog resource actually a ComboBoxEx, or is it only a standard ComboBox?
class CConfigDlg : public CDialog
{
public:
CConfigDlg(CWnd* pParent = NULL);
enum { IDD = IDD_CONFIG };
CComboBoxEx m_ctlCombo;
I don't know what's wrong
modified 12-Sep-18 21:01pm.
|
|
|
|
|
What does InsertItem() return?
suggestions:
1. you don't need invoke GetBuffer(0). you can use just Lock() and UnLock().
2. Clear COMBOBOXEXITEM before using by ZeroMemory().
3. set cchTextMax in COMBOBOXEXITEM
|
|
|
|
|
Gregor S. wrote:
Mike Upton wrote:
Is the control on the dialog resource actually a ComboBoxEx, or is it only a standard ComboBox?
class CConfigDlg : public CDialog
{
public:
CConfigDlg(CWnd* pParent = NULL);
enum { IDD = IDD_CONFIG };
CComboBoxEx m_ctlCombo;
Sorry, that's not what I meant. What I meant was, did you insert the control into the dialog resource (in the dialog resource editor) as a standard combo box or an extended combobox?
I've just created a test dialog based project using the AppWizard, added an extended combo box to the dialog (and used the wizard to add a control variable for it), added a bitmap to use for the images and an image list member in the dialog, then copied and pasted your code into the OnInitDialog method and everything works perfectly.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Oh, I didn't see the icon for the extended combobox in my dialog resource editor toolbar. I replaced my old comboboxes with the new ones an now everything works fine
Thank you very much for your help!
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hi,
how can i control the position where to insert my text, or is it only possible to append new text?
(i want to insert lines at the beginning of the already inserted text)
thanks
|
|
|
|
|
You could use SetSel(0,0) and then ReplaceSel("your text")
However, this is untested.
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I want to be able to have my application open when I double-click on one of the files that the app creates. I modified my app to take in command line parameters and when I double click on the file, I guess it doesn't send any command line parameters and so the app won't open up. Anyone got any ideas about how to pass in the command line parameters to the application when double-clicking on the file?
|
|
|
|
|
Since the steps are a bit long, so create a temporary project (SDI or MDI).
Normally, you have to call these functions in that order:
EnableShellOpen( );
RegisterShellFileTypes( TRUE );
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
in your CYourApp::InitInstance() . You will also have to modify the
resource script for your document type. Let's say you have a MDI App.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MYAPPTYPE,
RUNTIME_CLASS(CMyAppDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CMyAppView));
AddDocTemplate(pDocTemplate);
You need to change IDR_MYAPPTYPE resource string to match the extension of your application. The extension is the string just before MyApp.Document .
Like I said, the steps are a bit complex and long but this should get you to start.
Last Article:
Adding VBScript/JScript to C++ App
|
|
|
|