|
Can you show code snippet how do you use
|
|
|
|
|
Thanks for replying.
I am not using any code except the one automatically generated when you place a picture control on a dialogue and assign a bitmap.
To see the effect I'm trying to get...look at this screenshot http://sourceforge.net/project/screenshots.php?group_id=95013&ssid=18186 of a KeePass dialogue, notice how that banner is across the top of his dialogues. Any idea about how to do that?
Thanks,
BP
|
|
|
|
|
yes I see,you can use of StretchBlit for show your image but for get dimensions of window you can use of GetWindowRect <screentoclient< code=""> now you have left/right/top/bottom of window and you can use of their on StretchBlit
|
|
|
|
|
Hi to all,
I am new to Visual Studios 2003, i want to develop an application in VC++.net, so i have to work through the template Managed C++ Application Template.
But my Visual Studios 2003 doesn't have those Three Template available.
Can any one help me in this regard, i have to work on those template.
Do i have to install them separately or do i have to check any options???
Plz help me.
Thanks in Advance.
With Regards, Gopinath MV
|
|
|
|
|
Friends,
I have an edit control on a dialog box. I've placed some text in the edit box during dialog initialization. The problem is that, when the dialog appears on the screen, the entire text in the edit box is *selected*. I want to remove this selection, however i want the focus to remain in the edit control. I am doing something as follows but it is not working:
BOOL CWebServiceURLDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_editUrl.SetWindowText(_T("Tomato"));
m_editUrl.SetSel(-1, 0);
return TRUE;
}
Please tell me how to remove the selection.
Imtiaz
|
|
|
|
|
Imtiaz Murtaza wrote: m_editUrl.SetSel(-1, 0);
Try this
m_editUrl.SetSel( -1, 0, 0 );
|
|
|
|
|
Not working at all
Imtiaz
|
|
|
|
|
That's because your selection is being cancelled by what OnInitDialog() is doing when it finishes. You need to call PostMessage() instead, and in the handler for the message, call SetSel() . That will work.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Imtiaz Murtaza wrote: return TRUE;
You should return FALSE , if you want to set focus to a control in a dialog, from OnInitDialog .
As far as the selection issue is concerned I don't see any problem here. It's working here.
|
|
|
|
|
Hi,everyone. My application is based on Muti-Doc (VC6.0).
I created a controlbar in mainfrm (OnCreate()) and then created a tabcontrol in the controlbar (also in OnCreate()), then I created a TreeCtrl in the TabCtrl.
HTREEITEM hti1 = m_wndTree1.InsertItem(_T("Chapter1"));
HTREEITEM subroot1=m_wndTree1.InsertItem("section1",hti);
HTREEITEM hti2 = m_wndTree1.InsertItem(_T("Chapter2"));
Now I want to add "Chapter3" in the TreeCtrl by menu, what should I do???
If you can show some codes , that's better. Because I'm a begginner.
Thanks a lot.
|
|
|
|
|
wangpai wrote: HTREEITEM hti2 = m_wndTree1.InsertItem(_T("Chapter2"));
Um...
HTREEITEM hti3 = m_wndTree1.InsertItem(_T("Chapter3"));
seems obvious to me....
If you want a menu to add the item, then you need to put that code into the method called by a menu item.
|
|
|
|
|
I created the treectrl in mainfrm.cpp, and used ID_FILE_NEW_ADD menu item to do this work.
I add this to my codes:
void CMainFrame::OnFileNewAdd()
{
// TODO: Add your command handler code here
HTREEITEM hti3 = m_wndTree1.InsertItem(_T("Chapter3"));
}
But it didn't work.
|
|
|
|
|
Which didn't work InsertItem or event of ID_FILE_NEW_ADD
|
|
|
|
|
Ok, there is something I really don't get. I'm triing to use the function _strnset_s, but I get the compiler error : '_strnset_s': identifier not found, even with argument-dependent lookup.
The thing is that string.h is included in my project and at the line just before this one, I used strrchr wich need the same include and the compiler doesn't complain about this one. What did I do wrong?
here a very short version of my code:
stdafx.h :
#pragma once
#define WIN32_LEAN_AND_MEAN
headers
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// Others
#include <stdio.h>
#include <string.h>
#include <afx.h>
Form1.cpp :
#include "stdafx.h"
#include "Form1.h"
Form1.h :
#pragma once
#pragma push_macro("GetObject")
#undef GetObject
#pragma push_macro("MessageBox")
#undef MessageBox
namespace VampireReader
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
using namespace System::Runtime::InteropServices;
using namespace System::Text;
private:
System::ComponentModel::Container * components;
void InitializeComponent(void)...
private: void fOpenFile()
{
csDest = strrchr( csFName, '\\' );
_strnset_s( csDest, sizeof(csDest), ' ', 1 );
}
|
|
|
|
|
Maybe you are pointing to a string.h from a previous sdk.
Right click on the include, open string.h, and search for "_strnset_s".
If it's not there you need an SDK update.
|
|
|
|
|
_strnset_s is found in C++/CLI of VS2005. Looks like you are using Managed C++ of VS2003 because "System::ComponentModel::Container* components;" is MC++ 2003 and "System::ComponentModel::Container ^components;" is C++/CLI 2005.
-- modified at 21:05 Wednesday 8th November, 2006
|
|
|
|
|
Thanks, I didn't thinked about that.
|
|
|
|
|
I am getting a linking error:
LINK : fatal error LNK1181: cannot open input file "C:\Sensors.obj"
and Can someone tell me how to fix it. Since Sensors.obj have nothing to do with my project. I don't have any sensors.h or .cpp files.
Will really appreciate the help
Thanks
Anony
|
|
|
|
|
Look through your project ( a find in files can do this for you ) and see why it's looking for this file.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for the reply but it didn't work for this problem. When I do "FIND IN FILES" it gives, there is nothing like sensors.obj.
I am just hung up with the problem. What else I can do?
Thanks again
C++Prog
|
|
|
|
|
There must be a reference to it somewhere. Use windows explorer search or VS Find in Files feature to look for any file in your project that contains the text "sensors". If using Find In Files make sure you set the file type to *.*
|
|
|
|
|
Yeah, that's what I was advocating.
|
|
|
|
|
There has to be a reason that it's expecting to find this file, you searched for the word 'sensors' in the text of your entire project ?
|
|
|
|
|
Did you look in the project's .dsp file?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
no, will try that..
Thanks
C++Prog
|
|
|
|