|
I googled it but I couldn't find any useful informations...
Well... I am a beginner ...
|
|
|
|
|
Don't put the update statement within quotes (in other words,
"UPDATE ...." instead of "\"UPDATE ...\"")
Also, I wouldn't use sprintf to build your query string. Too easy to get buffer overflow problems. Use STL strings or string streams or just concatenate _bstr_t's
|
|
|
|
|
Thank you very much for your answer!
Remowing the quotes solved my problem and now it is working fine...
Thanks a lot again...
Well... I am a beginner ...
|
|
|
|
|
I have a class cat and i am trying to pass an array of cat obiject to a function as well as valid components of the array.
void show(Cat cats[], int i)
What is incorrect in my line?
|
|
|
|
|
|
Could anyone tell me what is wrong with the following snippet? printf only prints the the first word of each key and printes it several times.
for example Microsoft Office would be printed as
Microsoft
Microsoft
microsoft and so an..
I am using XP sp1 and VS2003
Thanks,
Max....
long RESULT;
HKEY hKey;
int _tmain(int argc, _TCHAR* argv[])
{
RESULT = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", 0, KEY_READ, &hKey);
printf("Regopen returned %d ", RESULT );
int KeyIndex = NULL;
CHAR SubKeyName[MAX_PATH];
DWORD SubKeyLenth = [MAX_PATH];
FILETIME InstallDate;
do
{
RESULT = RegEnumKeyEx(hKey,
KeyIndex,
SubKeyName,
&SubKeyLenth,
NULL,
NULL,
NULL,
&InstallDate);
printf( "(%d) %s\n", KeyIndex++ , SubKeyName);
}
while (RESULT != ERROR_NO_MORE_ITEMS);
return 0;
}
|
|
|
|
|
do
{
SubKeyLenth = MAX_PATH;
RESULT = RegEnumKeyEx(hKey, KeyIndex,SubKeyName,&SubKeyLenth,
NULL,NULL,NULL,&InstallDate);
printf( "(%d) %s\n", KeyIndex++ , SubKeyName);
}
SubKeyLenth <- is in/out and it needs to be reset on every iteration
|
|
|
|
|
Hi,
i am writing a program which produces a constant square wave form from Parallel port. I am doing this in a infinite while loop, the problem is i also want something to happen when i click a button on the dialog. How do i keep the loop runing and still be able to click a button?
THANKS
|
|
|
|
|
Check Subject below "App still works but GUI does not update when moved."
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Papa wrote:
while (TRUE)
Papa.WillLove ( Bebe ) ;
Not many events in your loop!;P
|
|
|
|
|
WillLove is a sum of events
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Yes you should put your loop in a thread but if youu want something quick and dirty, call the following function (DoEvents) in your loop.
<br />
BOOL DoEvents()<br />
{<br />
MSG msg;<br />
while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))<br />
{<br />
if (msg.message == WM_QUIT)<br />
{<br />
return FALSE;<br />
}<br />
if (!AfxGetApp()->PreTranslateMessage(&msg))<br />
{<br />
::TranslateMessage(&msg);<br />
::DispatchMessage(&msg);<br />
}<br />
}<br />
return TRUE;<br />
}<br />
|
|
|
|
|
Hi,
1. is manipulating font size, the only way to resize non-owner-drawn conbo box?
2. using SetFont() and resizing combo box, i get the combo box show right but calling GetWindowRect() with list box not dropped, returns some default size, no matter what the actual visible size is. how can i get the correcty visible size?
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
GetWindowRect should return the size of the combobox + the size of the drop window. When you use MoveWindow(0 on a combo box, the rect you provide includes the drop window size. When the drop window is not whown, I beleive that the combo box sizes to the size of GetSystemMetrics(SM_CYVSCROLL), but if your using a different font, it may not be correct.
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Thank you Roger,
the returned combo height is indeed constant (SM_CYVSCROLL = 20 on my system) and equals 24.
BUT
how can i get the visible size of the non-list-dropped combo ? is this a system constant as well !?
Roger Allen wrote:
GetWindowRect should return the size of the combobox + the size of the drop window. When you use MoveWindow(0 on a combo box, the rect you provide includes the drop window size. When the drop window is not whown, I beleive that the combo box sizes to the size of GetSystemMetrics(SM_CYVSCROLL), but if your using a different font, it may not be correct.
Roger Allen
Sonork 100.10016
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
Yonatan wrote:
how can i get the visible size of the non-list-dropped combo ? is this a system constant as well !?
Its something that I have looked for myself. I do not know of a specific constant for it. I have usually simulated it in the past by having another control the same height as a combobox on the form and measuring that.
The other thng you could do is add in some borders:
GetSystemMetrics(SM_CYBORDER) * 2 + GetSystemMetrics(SM_CYVSCROLL);
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Dear Roger, Dave, thank you again for your answers.
since English is not my mother tongue (hint: i fluently read the original scripture of Ecclesiastes, the resource of the poem Roger quotes ), the question i posed may have been somewhat unclear.
i want to embed a combobox inside a list control subitem. now, by changing the combo font size i can control the combo (==edit+arrow == -1 item) size (SetItemHeight(-1, x) fails here), and visibly make it smaller than system default (without resorting to Owner-Drawn combo). alas, i wish to programatically quantify the combo frame VISIBLE size, to some actual pixel measure (i do not wish to use the resource editor). i cannot get it with GetClient\WindowRect() because of unknown reasons (which have nothing to do with drop down list size).
i hope i could profit from your experience.
Thank you all , yonatan
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
Use CComboBox::GetItemHeight() /CComboBox::SetItemHeight() with nIndex set to -1 to get/set the height of the edit/static control portion of the combobox
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Dear PJ, thank you for your answer.
Please check my last answer to Roger.
please advise, , yonatan
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Email: y_becker@netvision.net.il
|
|
|
|
|
I have a problem with a FormView. How do you implement copy and paste.
How to activeate cut and paste in the controls on the form.
Please help
Jørgen Granborg
|
|
|
|
|
Add your own handlers for cut/copy/paste
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
void CXView::OnEditCopy()
{
CWnd* pWnd = GetFocus();
if ( pWnd != NULL )
pWnd -> SendMessage(WM_COPY);
}
|
|
|
|
|
Hello,
I am studying an doing applications with C#. I don´t know how transform an EJB to C#. Which are the equivalent files in C# to the files in Java where you define Local and Home Interface? Only with the .cs file and including using in the file where you want to use this classes you are programming with .Net Architecture or is necessary define interfaces in any place in Visual Studio.Net.
Thanks for your help
LUIS
|
|
|
|
|
How to add an item to desktop's context menu or is there an article to read about this?
|
|
|
|
|
For CodeProject articles dealing with programming the Shell and with the Shell API, see to General -> Shell Programming.
The desktop is a part of the Shell. Just like the Start Menu, Quick launch, Task Bar and Tray Area are parts of the Shell.
Here's a direct link to the Shell area: http://www.codeproject.com/shell/[^]
I recommend the article by Michael Dunn 'The Complete Idiot's Guide to Writing Shell Extensions', parts 1 to 8. Happy reading
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have dialog based application.
Main dialog contains it's own controls, like button, and one TabCtrl.
Tab control contains couple of child dialog windows, their visibility is determined by selected tab in tab control.
I need to make this resizable, but it's flickering to much, especially tab control and child winwow's controls.
I tried to disable OnEraseBkgnd on both main window and child windows, but with no effect.
How to do this ?
Thanks
rrrado
|
|
|
|