|
i'm new to this platform.am a student.need to create a dialog based library system to search for a book,add,delete,and display all from adatabase without creating a dsn.that's the last point i'm stuck on plz help
|
|
|
|
|
RAVISHBHAMBORE wrote: ...without creating a dsn.
There is an example here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi,
had raised a querry for this yesterday, though dint ne good ideas, so thought would share some info I found after trying out all possible things...
To create a dynamicly increasing array of objects, that is the arraysize should increase dynamically. You can follow the below steps in .NET environ
1. Create an arraylist eg
ArrayList arrayObj = new ArrayList();
2. Add the objects in arrayObj
arrayObj.Add( obj1, obj2.... );
3. Copy this arraylist to an object array of the specific class as under
ClassA[] obj1 = new ClassA[arrayObj.Count];
arrayObj.CopyTo( obj1, 0 );
Now obj1 is an array of objects of type ClassA !
Cheers!
|
|
|
|
|
damn !!!
you never said you were working for .NET !
simply because you asked this on Visual C++ forum, you got C++ answers.
if you wanted MC++ (Managed C++) code, then you should have asked this in the C++/CLI forum[^], which is dedicated to the new Managed C++ Visual C++ compiler mode...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
toxcct wrote: you never said you were working for .NET !
Geez, was so used to this forum! was the first time was workin on .NET! dint think of checking the CLI forum...and landed up in "apna" VC++ forum!
But hey look at the bright side, all got to know some .NET info as well eh!
If my query caused some brainknocking...sorry for that!
though this forum has always helped me!!!
Thanx!
|
|
|
|
|
I'm not seeing the correlation between the question and the answer. The code snippet that you've provided does not look like "a dynamicly increasing array of objects." It looks like one object array being copied to another. Could you not have just used std::array for this? It allows for dynamically growing/shrinking of the array.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: I'm not seeing the correlation between the question and the answer
actually, the question was there[^] (asked yesterday), and shown off his solution there...
and visibly, he wanted to use .net framework, which he never specified...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.24][3.0 soon...]
|
|
|
|
|
Hi,
I want to paint some overlay graphics upon a game screen (the game works with directx). I've tried to paint directly in the game HDC, but there's a lot of blinking because the game constantly paints upon my drawing (and viceversa).
How could I paint to eliminate the blinking? Would I have to use directx?
Any help will be highly appreciated.
-- modified at 6:58 Friday 24th February, 2006
|
|
|
|
|
Do all printing into a bitmap. When the picture is complete copy the bitmap (or parts of it) to the screen. That gets rid of al the blinking.
I might be able to give you some code, depending on what kind of class you are printing into.
|
|
|
|
|
hello all,
i have created an activex control in vc++ 6.O.It is a player.it will run .cam (video files).i tried to run this activex control in IE by copying its DLL.
It is running the video.but my problem is ,while moving the scroll bars (both horizontal & vertical scroll ) in the Internet explorer,the player stops playing and it is showing "Internet Exporer has encountered a problem with add-ons) and it closes the page.
I cant able to proceed further
Plz help me to resolve the problem.I will be very much thankful to u.
cheers
sangeet
|
|
|
|
|
You could run IE using the debugger. In project settings, in the Debug tab, it says "Executable for debug sessions" . Just enter the path for iexplore.exe , and then you can find the problem using the debugger.
I think it could be like repositioning code or drawing code causing the problem, but using the debugger will indeed help.
this is this.
|
|
|
|
|
hi khan,
thanks for ur reply.
I ran the project using activex test container.In that test container ,I can able to play the video.but if i move the player or reposition the player,I am geting error message "Debug Assertion failed".Also it leads to assembly code and asking SBheap.c file.
How to proceed further.Plz help me.
cheers
sangeet
-- modified at 1:15 Saturday 25th February, 2006
|
|
|
|
|
If you get to the source, then in one of the debug windows, there is a combo-box which shows the current context. It shows the current file or function where the assertion failed. You should see down in that combobox, where your file is. Then select your file from that list, the topmost one. That will show you the exact line which caused the assertion failure. I cannot say much about it because I do not have Visual Studio right now. But look in that combobox, you will find the file, the function, and the exact line where the assertion failed.
this is this.
|
|
|
|
|
Hi all,
I need to create a child window with some childs (edit, etc.) inside it. When the user clicks somewhere else (outside this window), it should be disappeared.
Could anybody help me, please?
Thank you.
- NS -
|
|
|
|
|
You need to handle WM_ACTIVATEAPP or WM_ACTIVATE
Nibu thomas
Software Developer
|
|
|
|
|
I think you could:
1- Create an array of HWND 's, that is enough to accomodate all the children.
2- In OnInitDialog() function, take the HWND 's associated with all the children into that array using GetDlgItem(...) etc.
3- Now start the timer at about 100ms etc. SetTimer(2,100,NULL);
4- In the timer function, check if any of the HWND 's in the array has focus. GetFocus() . It will return BOOL to let you know that somebody in that array has the focus. If nobody in that list has the focus, then hide the dialog using ShowWindow(SW_HIDE) etc. or close it, whatever you want.
5- Create this dialog as Modeless.
6- Now you are good to go.
And about KillFocus() etc, those functions don't work, because if there is even one child (except statics etc) on the window, that child will keep the focus, and the parent will never get the focus.
Hope that helps.
this is this.
|
|
|
|
|
khan++ wrote: 3- Now start the timer at about 100ms etc. SetTimer(2,100,NULL);4- In the timer function, check if any of the HWND's in the array has focus. GetFocus(). It will return BOOL to let you know that somebody in that array has the focus. If nobody in that list has the focus, then hide the dialog using ShowWindow(SW_HIDE) etc. or close it, whatever you want.
Hi Khan,
Sorry to trouble you again... Isn't that very Memory/CPU cosuming operation of checking focus every 100 MS.. as I believe you very well versed that timer is very scared resource and should be used properly.
Secondly, you are right that Kill Focus will not work in case of Model Dialog.. as Dialog should be closed to give focus back to parent. but what about ModelLess Dialog... you can easily close it down on receiveing KillFocus message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi Alok.
About the CPU consumption, I don't think it will make much difference. There may be like 20 children on the dialog, so it will check GetFocus() 20 times, which does not make much difference, but you can always make the timer longer, like 250ms etc.
And this technique will work for modeless dialogs only. Quite opposite to what it sounds, the modeless dialog will not get a KillFocus message if there is even one child (non-static based) on the dialog. The child always likes to keep the focus, and the parent will never receive the KillFocus message. Hence, I use this technique.
this is this.
|
|
|
|
|
khan++ wrote: I don't think it will make much difference. There may be like 20 children on the dialog, so it will check GetFocus() 20 times, which does not make much difference, but you can always make the timer longer, like 250ms etc.
Hai Brother! what about making seperate thread for same ?.. anyways Parents will receive kill focus message when user click or take keyboard focus outside of the parent reach ...
any way i agree with you solution, Bro!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
NS17 wrote: Could anybody help me, please?
handle WM_KILLFOCUS message
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank you...
But this is not a complete solution.
The focus will be in some other control in the main dialog. I can't change that. So killfocus will not work.
Typical examples of my need is the dropdown list of the combobox control, context menu, etc. I need the same behaviour. But in my case there will be some controls like scrollbar, buttons etc.
- NS -
|
|
|
|
|
Hello,
Ive got a Visual C++ Forms project and within it Im trying to get the device context for the whole screen. I used both:
<br />
using namespace System;<br />
using namespace System::ComponentModel;<br />
using namespace System::Drawing;<br />
using namespace System::Windows::Forms;<br />
<br />
hDC = ::GetDC(NULL);<br />
<br />
<br />
hDC = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);<br />
Both statements returned an error code of 5 when using GetLastError, which is Access Denied. I have no idea what this really means. Any ideas how I can get either of these statements to work?
Regards,
Mark
-- modified at 6:29 Friday 24th February, 2006
|
|
|
|
|
GetLastError returns the error-code of the *last* error to occur, not the result of the last API to be called (which could have been successful).
If GetDC / CreateDC return a non-NULL HDC then the calls succeed and GetLastError is meaningless.
James
http://www.catch22.net
|
|
|
|
|
Thanks for your reply but GetDC and CreateDC to not return anything.
The variables they assign to remain NULL, thats why I used GetLastError to see what was the problem. I just dont understand the meaning of Access is Denied in this case??
Mark
|
|
|
|
|
I use SetBkColor and SetTextColor methods in
OnCtlColor to paint editboxes, listboxes and
comboboxes with my colors instead of with
default Windows colors.
I don't know to override colors for selected items
or selected text.
Can someone help me ??
Thanks a lot !!!!
|
|
|
|