|
Hi, everyone
I am trying to develop some code to connect my local MS Access database. Now I have a very long char string, the length of this string could vary very differently. In my Access database, the field type is Memo. Now I am using ODBC function SQLBindParamenter to try to bind this string dynamically. My question is how should I set the columnsize parameter of the SQLBindParamenter method? I can always set a very huge number, like 50000, but the length of that string still could be larger. what should I do?
Anyone has any suggestions?
Thanks a lot in advance.
|
|
|
|
|
Hi !
Anyone knows about a tutorial where I could learn how to use CSpinButtonCtrl ?
Well, admit I have a MFC App with a CEdit and a CSpin.. next to it. How do I assign the CEdit as the buddy window for the CSpin ? My question could be : how do you retrieve the Cwnd * from a given control ?
Thanks
RaGe
|
|
|
|
|
Well, I got it alone =)
CWnd *tmp=GetDlgItem(IDC_EDIT);
m_Spin.SetBuddy(tmp);
in case other are interested ...
RaGe
Unfortunately, brute-force solutions tend to be slow
even when performed by modern-day microcomputers,
which are capable of several MIPS except when I'm late
for an appointment and want to finish a compile and
run just one more test before I leave, in which case
the crystal in my computer is apparently designed to
automatically revert to 1 Hz.
-- Michael Abrash
|
|
|
|
|
Just place Spin near edit in the dialog editor, invoke "Layout->Tab Order" menu command, and set spin tab number after edit tab number. Then select "AutoBuddy" property of spin and it will be automatically attached to edit control. In OnInitDilog function set the spin behavior, for example:
<br />
CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*) GetDlgItem(IDC_FREQ_SPIN);<br />
pSpin->SetRange(0, 20000);<br />
|
|
|
|
|
Sorry to nitpick, but the proximity of the two controls is meaningless. Only the tab order is important. Having them near each other makes the dialog easier to understand and maintain, but has no effect on functionality.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Michael Dunn wrote:
proximity of the two controls is meaningless
I know, I don't said, that it's needed. I recommended to use it for design purposes only.
|
|
|
|
|
hi !
I need to display a dialog box built in resource editor at a certain precise coordinate on
screen.
Is there anyway I can achive this without modifying the resource .RC file.
Actually I need to so this on the fly.
DeepBlue
|
|
|
|
|
SetWindowPos or MoveWindow, your choice.
-c
Cheap oil. It's worth it!
|
|
|
|
|
I tried using this one.. but couldn't get around the first parameter.
BOOL SetWindowPos( const CWnd* pWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags );
How do I use it ??
Thanks again
DeepBlue
|
|
|
|
|
it's usually of a set of predefined window ptrs. i just use wndTop (think that's what it is)
-c
Cheap oil. It's worth it!
|
|
|
|
|
Guys, I prefer to use SetWindowPlacement under win32 or CWnd::SetWindowPlacement Under MFC...
Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Carlos Antollini wrote:
I prefer to use SetWindowPlacement under win32
Well, if you want to do it quickly, MoveWindow() works really fine ... no other structure required ... a DOITINONELINE function
~RaGE();
|
|
|
|
|
In VB is
Form.Top = nTop
Form.Left = nLeft
hhmmm Two lines....
I prefer to return to Visual C++...., I like to write thousond of lines for make the same....
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Try a MoveWindow() (you can even resize your dialog with this one) like this :
MoveWindow(x,y,DialogSizex,DialogSizey,TRUE);
where x and y are your coordinates, DialogSizex the width and DialogSizey the height of your window.
RaGe
|
|
|
|
|
hi friend
i always prefer SetWindowHandle()API..BCzthat i sthe simple and traditional way to locate the window
the way must use
SetWindowPos(
HWND hWnd, // handle to window
HWND hWndInsertAfter, // placement-order handle
int X, // horizontal position
int Y, // vertical position
int cx, // width
int cy, // height
UINT uFlags // window-positioning options
)
i think ur doubt is about the second parameter hWndInsertAfter here just put HWND_TOPMOST which Places the window above all non-topmost windows
The TRUE CP -ian
|
|
|
|
|
In your WM_INITDIALOG handler, call SetWindowPos() and pass the x,y values you want the dialog to appear in. (Note that in MFC, you cannot use (0,0) since that is the default location and MFC will call CenterWindow() for you. Using any other position overrides this behavior.)
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
|
|
|
|
|
just try the CRect class members .. it works ..
|
|
|
|
|
Anybody here done any work with Exchange 2000 in C++. Can you recommend any good books for building solutions with Exchange?
Michael
|
|
|
|
|
The VC debugger is reporting memory leaks but not giving me source file name or line numbers as outlined in the following MSDN article for DumpAllObjects:
<url>http://msdn.microsoft.com/library/en-us/vccore98/HTML/_core_dumping_all_objects.asp
As you notice the example displays filename and line number where the leak occured. I have been trying all kinds of things but cannot get it to display this way (in debug window, file, or console window). I only get:
Dumping objects ->
{372970} normal block at 0x0242AEB8, 8 bytes long.
Data: < xL > 08 78 4C 10 01 00 00 00
and more like it. I have been using CMemoryState objects and _CrtSetReportMode, _CrtSetReportFile, etc. I have put all of that code in the main() function hoping it will catch all errors in all other modules.
Does anyone know how to do this and/or have an example????? TIA.
|
|
|
|
|
see that first number? that's the allocation number.
put this at the very beginning of your app:
_crtBreakAlloc = 372970;
you'll get an assertion when that allocation happens. back up the call stack and there you go... the only trick is to make sure you run the app exactly the same way - since you're breaking on the Nth memory allocation. if you change the allocation order even by one, you'll be lost.
-c
Cheap oil. It's worth it!
|
|
|
|
|
OMG, I never knew about that!!!
(makes notes)
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?
|
|
|
|
|
fun geek trivia
-c
Cheap oil. It's worth it!
|
|
|
|
|
I'll second Tim , here . Neither do I
This is sometimes nice to use instead of the break at memory address
Adding this to my favourites ... this could cause some delay due TCL speed limitations ... done !
Thanks Man !
Cheers,
Joao Vaz
A person who is nice to you, but rude to the waiter, is not a nice person - Natalie Portman (Padme/Amidala of Star Wars)
|
|
|
|
|
Chris Losinger wrote:
put this at the very beginning of your app:
_crtBreakAlloc = 372970;
you'll get an assertion when that allocation happens.
Cool trick.
Where did you learn this useful tidbit?
--
Dana Holt
Xenos Software
|
|
|
|
|
i think it's in the MSDN somewhere.
-c
Cheap oil. It's worth it!
|
|
|
|