|
Thank you for your suggestion. Now I am following your suggestion to rewrite the business logic into an ATL component. Now there are some new problems.
For example. I have created two ATL object 'Student'and 'Teacher', and 'Student' is a property of 'ITeacher'.In idl, it seems the function can not return the user define class type.Then how can I get the 'Student' property in VB??
in idl:
[propget, id(1), helpstring("property Student")] HRESULT Student([out, retval] CStudent *pVal);
[propput, id(1), helpstring("property Student")] HRESULT Student([in] CStudent newVal);
E:\Programming\Study\ClassReturn\ClassReturn.idl(30) : error MIDL2025 : syntax error : expecting a type specification near "CStudent"
|
|
|
|
|
You can only return the types accepted by the IDL compiler. The easiest way in my experience to pass back data such as the details of a student is to pass it as XML. An XML string can contain as many different data items as you like, so long as they can be represented as text.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
|
|
|
|
|
CAtlArray is MUCH better than MFC array (thank god).
Also, for UNICODE/MLSU/ANSI applications, std::string has too many limitations. I have found that CStringT works much better in Windows applications.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
Tim Smith wrote:
Also, for UNICODE/MLSU/ANSI applications, std::string has too many limitations.
You'll note I am not as damning of CString, there are definately ways in which it is better than std::string. I tend to use std::string, std::wstring and _bstr_t myself, but CString is not actually inferior, as CArray is.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I have a function that uses the AddNew method of the _RecordsetPtr to save information to an Oracle table. The problem is that it only works once. The next time the function is called I get an "Invalid page fault" error referencing SQORA32.DLL. Besides closing and maybe NULLing the RecordsetPtr object at the end of the function, is there something else I should be doing so that the function can be called again to do another save?
Thanks
|
|
|
|
|
You must to use the begintransaction and Committransaction functions
Best regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks for the suggestion. I tried it but it still does the same thing. I ran the debugger on the code and it seems to get hung up on Open method of the _RecordsetPtr object. Like I said, it works fine the first time I use the function and write to the table, but try to call the function again and it gives me the error.
Is there something else I can try?
Thanks...
|
|
|
|
|
If you are wotking with ADO, you must try with my classes
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I'm trying to dynamically give my static control the WS_EX_STATICEDGE style but it's not working. I've tried
GetDlgItem( IDC_MYSTATIC )->ModifyStyle(0,WS_EX_STATICEDGE); and also
GetDlgItem( IDC_MYSTATIC ->ModifyStyleEx(0, WS_EX_STATICEDGE); but neither seems to work. Any help?
-Raffi
|
|
|
|
|
The Windows static control doesn't repaint automatically when you modify the style. Try the following:
<br />
GetDlgItem(IDC_MYSTATIC)->ModifyStyleEx(0,WS_EX_STATICEDGE);<br />
GetDlgItem(IDC_MYSTATIC)->Invalidate();<br />
GetDlgItem(IDC_MYSTATIC)->UpdateWindow();<br />
BTW, you may need to experiment with this a little. Take a look at RedrawWindow() as well.
Gary R. Wheeler
|
|
|
|
|
I am trying to figure out what is the best way to store old records in a database. Basically, I am trying to write some kind of archive function that will do record maintenance to keep the database relativly small. So if I have a table of purchases and I want to keep only the records that are newer than 90 days and move the older ones to some archive file.
My question is, what is the best way to store the archived records? XML? another database? some other method?
I am leaning toward XML but I really don't know enough about it. So on to my next question. Does anyone have a class that will take a recordset using ODBC and write an XML file?
Thanks in advance.
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
Personally, I would just go with another database. A database is obviously more robust than XML. Transactions, automatic backups, etc. XML is just a plain text file. Backups and transactions would have to be handled manually.
|
|
|
|
|
This may sound weird but is Visual C++ able to do game design if you "remove" the Visual aspects? Can you produce code worthy of game design with it or should I try other approaches/other software? I guess I need to know a bit on the basics of game design... Thx!
|
|
|
|
|
I"m not sure I understand what you mewan by "visual" aspects...but
I use visual C++ ide for writting code in PHP/JScript/HTML/ASP and anything else with c syntax style code. Just cuz I know it really well and I use it all the time...
I've used visual ide for writting code in plain jane c and c++ and compiled under different compilers no problem...Bloodshed C++ editor is no friend of mine, but I have the learning edition of VC++ so compiled exe's always have a warning of sorts compiled into the final output, so I often use third party compilers to avoid such problems...
If you mean can you write games in VC++ without using the windows visual aspects like windows and such...sure just don't include the MFC library and use windows native SDK function calls...
HTH
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Depends what you need.
Basically depends of the platform in which will run the game....
For example I wrote game for XBOX and used VC++, with directX SDK.... (I had no problems). Now I am rewriten that game for PC, and also We are using VC++...
Best Regards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
You can produce games with VC++. You just have to forget about MFC as a framework. If you use the application wizard to produce a Win32 application for you. You'll then have a starting point for writing a game. Have a look at the DirectX tutorials on the platform SDK.
Lots of "real" game developers use VC++.
Michael
Look, try and use your intelligence, man, even if you are a politician. - The Doctor
|
|
|
|
|
I have a dialog-based application with a few buttons on it, by default, if I press "enter" or "space" key, the button which has focus on it gets triggered, if I press "ESC", the dialog closes. But I don't want those, I need my application only respond to mouse clicks, I want it completely ignore any keyboard event. How can it be done? Thank you.
|
|
|
|
|
Read the FAQ.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
If I override OnCancel() then I cannot close the dialog by clicking the [x] on system menu. Is there a way so that it ignores all keyboard events, but it does respond to any appropriate mouse click. Thanks in advance.
|
|
|
|
|
I very much doubt that is what the FAQ says. You should override OnKeyDown OR if you override OnCancel you should use GetAsyncKeyState to continue only of escape is not being pressed at the time.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I have searched the FAQ and all it says is to override OnOK() and OnCancel(), could you please point me to the correct URL? And I tried to handle the dialog's WM_KEYDOWN and WM_CHAR events, didn't work, dialog went ahead and closed without those events even being triggered.
|
|
|
|
|
I've always done it in OnCancel and OnOK as I described, but I thought OnKeyDown would work. If not, the you'll need to override PreTranslateMessage and supress the keyboard messages altogether.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Yeah overriding PrepTranslateMessage() is exactly the way that solves my problem. Thanks alot for your enlightenment.
|
|
|
|
|
you can overload the dialog member function OnOk() and OnCancel().then i think you will deal with your problem.
Mr.Whelk
Zhuhai City ,Guangdong ,China
|
|
|
|
|
Hello,
I am getting two linker warnings when I compile my dialog based program written in VStudio 6.0. I am using DAO connectivity in my program.
The warnings that I am getting are --
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
In my project settings under Link Tab, I have following information --
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ddao35.lib ddao35D.lib ddao35U.lib ddao35UD.lib /nologo /subsystem:windows /incremental:no /pdb:"Release/TDMS2000.pdb" /machine:I386 /out:"Release/TDMS2000.exe"
Please advise how and if I need to change my project settings. Thanks !
Anjum.
|
|
|
|