|
You should do as such:
CString str = "ok";
MyFunction( str );
...
...
// str value is now "test"
void MyFunction( CString& str )
{
str = "test";
}
What happens here is that you pass str as a reference (it's adress instead of it's value). So when the function ends, the variable is still valid since it wasn't create within the function scope.
Hope it helps!
---------------
http://www.edovia.com
|
|
|
|
|
I'm working a project on oracle8.06. To export data in oracle to .dbf in Visual foxpro6.0,i create ADOConnection
and ADORecordset.However,i don't know how to set para in
ADOConnection->open() and ADORecordset.I find vfpodbc.dll
instead of vfpole.dll. Does it work in ado?
Every time i call ADORecordset->open(),The "3105 error"will appear.How do i solve it,Please?
Thanks.
|
|
|
|
|
I need to format the data before showing it in MS Data Grid bound to a database.
I have spent a lot of time on this but to no avail.
Any help will be appreciated.
Ammar
There is a difference in knowing the path and walking the path.
|
|
|
|
|
Can anyone recommend a good tool for formatting C++ source/header files. ie. fixing tabs, etc. I do the Alt F8 thing but it means I have to actually open every file. Does Visual C++ have some hidden standalone exe that does this?
|
|
|
|
|
maybe to much work but get UltraEdit32 and write a Makro - it's easy (I used UltraEdit32 for some other reasons - dataconversion from unix to w32 and such stuff and the makro-section is really easy to use)
flo
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
I have the following problem: I dynamically create the items of a CTabCtrls and switch the option "MultiLine" on in ResourceEditor. When adding a new item I don't know how to handle the SetWindowPos correctly of the new items. as long as there is just one line of items i can see my inserted dialogs perfectly but if the tabctrl adds a new row (multiline) i cant see the second row because over the second row there is the item displayed. i tried to determine the rowcount by GetRowCount but this doesn't work, although I switch the Multiline-Option on. I also tried to put an additional ModifyStyle(0,TCS_MULTILINE), but this delivers only 0.
Has anybody an idea how to solve my problem.
thanks a lot in advance
flo
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
Did you try CTabCtrl::AdjustRect?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
yes, I tried this, but actually AdjustRect doesn't take care about the number of items. So AdjustRect delivers just the modification which is necessary to fit the hole ClientRect of the tabcontrol but doesn't look up the number of rows.
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
AdjustRect works perfectly for me - with multiline tab controls as well. Post the code which calls AdjustRect.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
so, I wrote a own TabCtrl were I use DrawItem and so on an there I recalculate the item's position. I guess this is the one an only possibility if someone wants to add dynamically contents to a tabctrl.
if someone has a better idea please let me know...
thanks
I don't want achieve immortality through my work - I want achieve it through not dying - Woody Allen
|
|
|
|
|
Bit Lengthy pls spare time
Hello All,
Let me tell you the problem clearly.We have a third party Dialog Dll which is loaded into the current application process when we choose a menu item called "Insert Dialog".Now when the user clicks File|Exit the application used to crash telling that unhandled exception in the Dialog Dll.Since its a third party Dll we dont have the source code.
So the solution i have hit upon to avoid the crash is that when the user tries to close the application you check whether that dialog Editor is open through FindWindow and if so ask the user to close the dialog before the File exit.This is working absolutely fine and its not crashing.
But the new Problem is with FindWindow.If there is another instance of the application and in that too if a dialog is open and even though the dialog is closed in the current application FindWindow keeps telling Pls close the dialog before the exit(This is because its finding that dialog window is open in the other application)
Now my doubt is how to force the FindWindow to seach in the current instance of the application only and not in others???
Thanks a lot for the patient hearing..
Hope i get the solution.
Luv,
pradeep
|
|
|
|
|
Use EnumWindows, for each window check the class/caption and process id (with GetWindowThreadProcessId).
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks for the reply Tomasz.But i could not get what you are telling.Some code snippet would really really help me.Expecting your mail.
|
|
|
|
|
1) use EnumWindows to enumerate all toplevel windows
2) for each window, check its class/caption.
3) if this is 3rd party dialog, you need to check if it's part of your application, or maybe another instance created this window
4) GetWindowThreadProcessId returns the process id given HWND. If your process id retrieved by GetCurrentProcessId is equal to HWND's process id, then this is your dialog.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks a lot lot lot tomasz i dont know how to thank you.Actually am falling short of words.
Its great it solved my problem.
Have a nice day!
bye
|
|
|
|
|
Hi all,
I have a very general question about OpenGL. All the OpenGL examples that I have seen, which involves some rotation or transformation always take 100% of the CPU time! Is this because of the message pump or there is some other reason behind it? is it possible to circumvent this??
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
All opengl interative applications are trying to draw as many frames as possible. Taking up 100% CPU is quite normal for graphics intensive apps using either Opengl or DirectX.
If you're worried that some other apps or threads in the same Opengl app are not getting enough time slices insert a Sleep(0) after drawing doing a glSwapBuffer() call. This will give the rest of the time slice to any other thread which needs it.
HTH
Brian Azzopardi
bibamus, edamus, cras moriemur [eat, drink, for tomorrow we die]
|
|
|
|
|
Yes, just as what Briane has said, most of the OpenGL example is written for Win32, and the DrawGLWindow is called when there is no message waiting in the message queue. That's why it's taking up 100% CPU.
If you are developing a game, it's usual to have a Sleep(xxx) after the DrawGLWindow is called, so that you have a constant display update frequency.
|
|
|
|
|
How can I determine the horizontal/vertical spacing between characters?
The real deal is:
Is there some other GDI beside GetTextExtent() that can calculate text size? GetTextExtent() wont calculate the '\n' char...
10xxx
--BlackSmith--
"The roof is on fire, we don't need no water, let the MF burn", BHG.
|
|
|
|
|
BlackSmith wrote:
Is there some other GDI beside GetTextExtent() that can calculate text size? GetTextExtent() wont calculate the '\n' char...
DrawText with DT_CALCRECT will do. I'm assuming you want to get the height of multi-line text.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Does anybody know how?
I've looked in registry but not successful.
Do I need to use some network protocol (snmp, ..)?
Thanks,
M.
|
|
|
|
|
If you're using W2000 or XP, you can use the DnsQuery API from the Platform SDK.
DNS_STATUS WINAPI DnsQuery (<br />
LPSTR lpstrName,<br />
WORD wType,<br />
DWORD fOptions,<br />
PIP4_ARRAY aipServers,<br />
PDNS_RECORD *ppQueryResultsSet,<br />
PVOID *pReserved <br />
);
Specify DNS_TYPE_WINS as wType . Never tried that but it should work The ppQueryResultsSet contains DNS_WINS_DATA structures.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
Sorry, I use Windows NT.
Marek.
|
|
|
|
|
At last solution you could execute "ipconfig /all", catch the output and parse it. Of course, I also would prefer a nice API call, but if you fail to find something, this may be an easy and pragmatic solution.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Thanks, I've considered this solution.
But the problem is that I can't run ipconfig without opening its console window (or, if I can, how?).
This is real project for customer, not only for my home usage.
M.
|
|
|
|