|
Okay, thanks. I am putting my fields in a listbox, and didnt want my blob field to show up. SO ii suppose I'll test for it and exclude it while populating the box.
ns
|
|
|
|
|
You can go the lazy route and just use *. But if your blob data can be large I would consider it a worthy optimization to type out all of the fields. You could use a stored procedure to keep from having to type it multiple times.
Todd Smith
|
|
|
|
|
Great optimization observation. I'm in a catch-22 situation though - I dont know how many fields there are, or what the names are. SO I do a select * and iterate through the fields to get that info. (I populate a listctrl with the names, so I was contemplating catching the blob field name and filtering it out). I f I'm missing something obvious, I'd like to know....
Thanks,
ns
|
|
|
|
|
Try to use view instead of table for search.
|
|
|
|
|
WEll,
This means I go in search of what a view is. None of the simple SQL stuff and basic db stuff I've seen (and its very little) speaks of views. If you have any links let me know.
Thanks,
ns
|
|
|
|
|
Something like below. Same way you write a SQL statement to create table. Reasons you write one is to help organise your SQL statement call and optimize in some sense as it will be compiled into an object in your DBMS.
create or replace view v_something as
select S.ID, S.CODE, U.NAME
from
salesman s, user u
where
U.id = S.User_ID
with read only
|
|
|
|
|
Is there a way to optain a pointer to the device context of a CFontDialog box before opening it?
My dog is anisotropic, but he doesn't scale easily like this mapping mode does... Practical C++ Jon Bates and Tim Tompkins
|
|
|
|
|
In my dialog based application I modify the background of
the dialog ,now they looks very nice.
But in my application I also use MessageBox() to send some information to user,but their background is still grey.
How can I change the background of MessageBox()?
any help will be appr eciate ,thanks.;)
|
|
|
|
|
fyl_jf wrote:
How can I change the background of MessageBox()?
AFAIK, there's no easy way for that. You may try to use MFC approach: set the WH_CBT hook before calling MessageBox, subclass the message box and modify the background by intercepting WM_ERASEBKGND.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Thanks for your help!
but I'm a beginner,and I don't know how to set the WH_CBT
hook.Can you explain it more clearly or post code to me?
|
|
|
|
|
Hi,
I have a CFormView based application. The dialog is created using the dialog editor. When I compile and run the program the initial size of the window is always too small to show all controls, resulting in ugly scrollbars.
I am looking for a smart way that ensures that the initial size of the application window is just big enough to show all controls.
How do I do this?
Woody
|
|
|
|
|
Look at WM_GETMINMAXINFO. You can specify the min and max size of your frame, so your formview fits.
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
Thanks. One more question. How do I determine the required size. For example, I draw four listboxes next to each other. How do I determine the total size of these listboxes and thus the total dialog size.
Woody
|
|
|
|
|
|
Hi!
I am trying to build an SDI with some dialog box in it. Those dialog box contain buttons. I want be able to click those button and then retreive data from my CDoc derived class and then do some process with it. After that I want to update the list box in the dialog box.
I've tried adding message handler in the dialog box class but then I can't process the data as I can't get to the data in CDoc like the CView class did by using GetDocument(). I've tried many things but it did not work. Can a button in dialog box be used to invoke a function in CDoc or CView derived class?
Does anyone knows how to retrieve and send data from dialog box to CDoc derived class or CView derived class? I desperately need some example
Newbies
|
|
|
|
|
Add a document pointer to your dialog class and set it before calling DoModal(). This will give you access to the document when the user clicks the button:
class CMyDlg : public CDialog<br />
{<br />
public:<br />
CMyDocument *pDoc;<br />
};<br />
<br />
CMyDocument::OnShowDlg()<br />
{<br />
CMyDlg dlg;<br />
dlg.pDoc = this;<br />
}
Capixx?
Drinking In The Sun
Forgot Password?
|
|
|
|
|
I had exactly the same Q. My understanding, however, is that the dialog should be placed in the view, and not the document. the 'CMyDocument::OnShowDlg()' line in one of the replies before implies that the dialog is not part of the view. Is that correct?
Isn't there a way to have the DDX from the dialog directly update member variables in the document class? Dialogs updating document class(es) seems to be such a common occurence, such that someone must have a straightforward answer to this. Thx you all,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
Hey Zayax,
I'm new too, but I think you want to use DDX. Essentially, you create a link between the dialog and it's parent, and transfer info that way. I'm still learning about, and it's caused me some headaches over the past few days, but try that direction in your searching.
Hope that helps some.
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Special thanks to all the Gurus that had help me. Sorry I can't respond earlier to your reply because my internet provider connection has been down until now. Your advice has worked. Keep up the good work. Arigato Gozaimashita
Newbies
|
|
|
|
|
For using Smart Pointer, it'll handle all reference counting for me. However, for some cases, I couldn't use it.
Can anyone tell me the following functions if AddRef() is called automatically, or I should call it explicitly.
1. CComObject<t>::CreateInstance()
2. CComObject<t>::QueryInstance()
3. CoCreateInstance()
4. SmartPtr->CreateInstance() -- (i supposed addref-ed auto)
5. SmartPtr->QueryInterface() -- (i supposed addref-ed auto)
6. pUnknown->QueryInterface()
I see from many samples, the codes are just called CoCreateInstance() or pUnknown->QueryInterface() to return the pointer directly without calling AddRef(). It will do automatically ?
|
|
|
|
|
All of those functions call add ref before returning the pointer.
QueryInterface calls Addref internally before returning the new interface that you are querying.
CComObject::CreateInstance calls CoCreateInstance, which internally calls QueryInterface.
Are you having any particular problems, or are you just making sure?
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!
|
|
|
|
|
I tried CComObject::CreateInstance is not calling CoCreateInstance, it just called new only.
|
|
|
|
|
You are right about CComObject::CreateInstance, I forgot this is the function that creates the object in ATL. However, I still beleive that it calls Query Interface so I think you should still be safe with this function.
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!
|
|
|
|
|
I need to create Dll in VC++.I created a Dll using the option Win32 Dynamic Link Library from the options and added a .def file to mention the functions exproted by the Dll.Now I want to get my Dll registered.I used the command regsvr32 Dllfilename.dll.But instead of registering a message is popped up saying ::-
Dllfilename.dll was loaded,but the DllRegisterServer entry point was not found.
DllRegisterServer may not be exported,or a corrupt version of Dllfilename.dll may be in memory.Consider using Pview to detect and remove it.
I'm not able to trace the error.Can anybody help??
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
You only need to register your DLL if it contains a COM server.
If you have simply created a DLL that exports a few API functions, then you do not need to call regsvr32.
If you want to use that DLL in another program you can call LoadLibrary then GetProcAddress to create a function pointer to the functions that you have exported from you DLL.
Or if you want to statically link your DLL to another program you can link your program to the .lib file that is created in the DLL, and that will allow you to simply call the function directly in your code.
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!
|
|
|
|