|
I have created the control derivative from CEdit .
Inside him, from the right side, it is necessary for me to arrange CScrollBar .
I have two questions:
1. How correctly to choose ID for him?
2. Where correctly to create CScrollBar (standard scrolling does not approach, because it is necessary for me to create CScrollBar smaller length than height of the control)?
Excuse, if my questions will seem children's
Best regards,
Eugene Pustovoyt
Eugene Pustovoyt
Sonork ID 100.10002:Yaumen
|
|
|
|
|
1. Any non 0 value should be OK. You will be creating the scrollbar as a child of the edit control, so it will not be clashing with anything else unless your CEdit derived class has a lot of child windows.
2. You can create the scroll bar in the OnCreate of your CEdit controls derived class. Call the base class first then create the scroll bar. You will also need to override the OnSize() to correctly possition the scrollbar in the CEdit's client area. Don't forget to check that the window is valid before calling MoveWindow on it.
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
I tried to use OnCreate , but at use SubclassDlgItem() I do not get in OnCreate .
Therefore I have decided to create scroll bar in a PreSubclassWindow () method.
But there is one problem!!! I do not know exact height and a position scrollbar yet I shall not start draws the control in OnPaint. How to be in this case?
Best regards,
Eugene Pustovoyt
Sonork ID 100.10002:Yaumen
|
|
|
|
|
Ahh, that makes it more clear. Because you are sub-classing the item, this happens in a dialog OnInitDialog function. I would write a public function as part of the class to create the scrollbar. Something like this:
bool CMyEdit::CreateScrollBar()
{
CRect rect ;
GetClientRect(&rect) ;
if (!m_ScrollBar.Create(WS_CHILD | WS_VISIBLE | SBS_HORZ, rect, this, 1))
{
TRACE("Failed to create scroll bar\n") ;
return false ;
}
return true ;
}
You would then call this in the OnINitDialog after the control has been sub-classed.
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
Thank for the help!!!
Now I create CScrollBar<code> in <code>PreSubclassWindow()
pVScroll.Create(WS_CHILD | WS_VISIBLE | SBS_VERT | SBS_RIGHTALIGN, CRect (0, 0, 100, 100), this, 100);
And then in function OnPaint() when becomes the sizes scrollbar are known, I do the following
pVScroll.MoveWindow(rect);
As far as I do correctly all?
Best regards,
Eugene Pustovoyt
Sonork ID 100.10002:Yaumen
|
|
|
|
|
It's better to move (resize) the scrollbar when your edit control gets a WM_SIZE , not WM_PAINT . A WM_PAINT handler should be as fast as possible.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I need to do some owner draw/ custom controls, and i dont have a clue
|
|
|
|
|
What king of control do you want? There are lots of sample in codeproject.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
You may have a look at Chris' Creating Custom Controls or Create your own controls - the art of subclassing.
Regards
Thomas
Finally with Sonork id: 100.10453 Thömmi
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
Newbie Question!
I need the integer value in a 'command line char array' to increment with the for loop.
eg
On the first loop the cmdline[]="C:\\myexecutable --getmemory SM 1";
On the second loop the cmdline[]="C:\\myexecutable --getmemory SM 2";
On the third loop the cmdline[]="C:\\myexecutable --getmemory SM 3";
etc, for 10 loops.
I have tried the following
for(int i =1; i<=10; i++)
{
char strInitial[] = "C:\\myexecutable --getmemory SM ";
char cmdline[]=("%s [i]", strInitial);
...//snip
}
But I get the following error:
error C2440: 'initializing' : cannot convert from 'char *' to 'char []'
Or if I remove the ()'s
for(int i =1; i<=10; i++)
{
char strInitial[] = "C:\\myexecutable --getmemory SM ";
char cmdline[]="%s [i]", strInitial;
...//snip
}
Then I get the following error:
error C2040: 'strInitial' : 'char' differs in levels of indirection from 'char [49]'
Please help!
Thanks.
|
|
|
|
|
Try this
char szBuffer [256];
sprintf (szBuffer, "C:\\myexecutable --getmemory SM %i", i);
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Works great, Thanks a million!
|
|
|
|
|
hi ,
My application's architecture is as follows :
CMainFrm-->CMDIChildFrame-->CDialog
The MainFrame has instances of the MDIChildFrame . The child Frames display a Dialog . I need to pass a message from the Dialog to the MainFrame. What is the exact way to send a notification from the Dialog and write ,register a handler in my mainframe .
Please help
|
|
|
|
|
how could i make a window transparent for win32 not MFC
ta, any help will be greatful.
|
|
|
|
|
You can set the WS_EX_TRANSPARENT ex_style, but this will only work for Windows2000 and above. You can also use SetWindowRgn to make your window appear that it has holes in it.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
any better ways to make the whole window 50% transparent
|
|
|
|
|
You may find a wonderful article from MAK Jeelani about transparent windows at:
http://www.codeproject.com/csharp/transparentwindowsincsharp.asp
It's in C# but if you writing MC++ is easy to follow!
Otherwise try this article from Franz Brunner:
http://www.codeproject.com/useritems/pellucid.asp
Hope this helps
Al
|
|
|
|
|
Hi,
What means this :
Optional feature not implemented
State:S1C00,Native ,Origin:[Microsoft][ODBC SQL Server Driver]
???? Is this any error ??
....
m_rec->Open(AFX_DB_USE_DEFAULT_TYPE,Sql.GetBuffer(0));
....
For connection to SQL server Iam using CDatabase+CRecordset
Thanks.
Wiizi
|
|
|
|
|
For the Successfull conection with the ODBC
You must
1)Create a CDatabase object
2)Connect the database with the ConnectionString inm the Format DSN;Username;password
3)Create a Recordset object
4)set the m_pDatabase member to the address of the database object
5)Open the Recordset with the Query
Follow the Steps ..
Good Luck..
try it now..
any doubts..??
Hai Friends me from Pandalam..and i think there is a sofware behind everything...
so enjoy with the codes...
|
|
|
|
|
Yes, I do it as you write ... Member function CRecordset::Open retured true -> but in debug window is :
Optional feature not implemented
State:S1C00,Native ,Origin:[Microsoft][ODBC SQL Server Driver]. I dont know if is any error in code or error in SQL server, SQL Server driver ??
Wiizi
|
|
|
|
|
please send the code ....
There is a Software Behind Everything
Renjith PDLM
|
|
|
|
|
See here
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks. Support the class transaction ?
Wiizi
|
|
|
|
|
What do you call Transaction, Stored Procedures?...;)
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Update datas in database on server
Wiizi
|
|
|
|