|
You can pass the pointer as a long, as pointed out earlier. Whether that pointer has any meaning on the other side...
|
|
|
|
|
i need to know how i can delete a cookie or all temporary internet files at once.
Thanks
Kun
|
|
|
|
|
How to retain the child windows' title when moving around different child windows.
I used SetWindowsText but it disappears when other child window is activated.
Gracias
|
|
|
|
|
i need to store the path (only the path) where my .exe file is run from in a string.
groovy, hehe
oops yea, i also need to know how i can delete a cookie in the temporary internet files folder because they dont seem to act as files
Thanx!
Kun
|
|
|
|
|
I pulled this from my library of routines
Good luck with the cookies
Brad
CString GetLaunchedDir()
{
TCHAR szFullPath[MAX_PATH];
TCHAR szDir[_MAX_DIR];
TCHAR szDrive[_MAX_DRIVE];
CString strLaunched;
::GetModuleFileName(NULL, szFullPath, MAX_PATH);
_splitpath(szFullPath, szDrive, szDir, NULL, NULL);
strLaunched.Format(_T("%s%s"), szDrive, szDir);
return strLaunched;
}
|
|
|
|
|
Hai,
I made a program to input .txt into MS Access.The text file is an output of a math program.Fine.
Now another program retrieves the data and displays it in the list control.Not fine.
The problem is the numbers displayed in the list contains an additional point other than the one already present.
When I checked in the database,it was correct ie same as that in the text file but the point gets added in the list control.Why?Whats the point?
The database fields are strings.
This problem occurs only to certain numbers in random.
I am confused.I need to use this in further calculations but it will harm my other calculations.
Help me.
And this,both the programs DONOT work simultaneously.The first was just a tool to help inputting thousands of numbers from text.
Thanx.
|
|
|
|
|
Hi all,
What is Project->Setting->C/C++->Optimazation ?
I can see Maximize Speed ...
Is that for speed in executing my EXE file ?
I mean, if i choose that, my EXE file will running faster ?
So, this option is for my EXE speed ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
yes, it's the speed of your exe...
A compiler man make different optimizations of your code. It can make your program run faster, make a smaller executable, and other stuff.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I am trying to make a program that will stream MP3s over a TCP/IP LAN, what would be the best way to set something like this up.
Thanks
-Matt Newman
|
|
|
|
|
I am having a rather anoying problem with my CString's. Consider the following code:
CString strTest = _T("hello world");
ASSERT(strTest.Replace(_T("world"), _T("universe")) > 0)
ASSERT(strTest.Find(_T("world")) == -1)
Now, that the last ASSERT will always fail (indicating that "world" is present in the string). This can be verified by sticking an AfxMessageBox call in there too.
Why (or rather how) can this happen when the replace call always succeeds with one replacement.
Cheers,
James Millson
|
|
|
|
|
I think the culprit is your last ASSERT statement, CString's Find member returns -1, if the sub string was not found.
It should be:
ASSERT ( strTest.Find ( _T ( "world" ) ) != -1 )
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Nope, It should be just as James wrote it...
You want the ASSERT to PASS if "world" is NOT found.
In fact I compiled this snippet and both asserts
pass just fine on my system.
Steve T.
|
|
|
|
|
Your right Steve, I have no idea what it was that I thought he was asking... This kind of thing has been happening all day, I must be on crack or something
cheers,
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
That's what I thought . I can only get it to pass on my system if I do:
CString strTemp = _T("hello world");
CString strTest = new CString(strTemp).GetBuffer(0);
ASSERT(strTest.Replace(_T("world"), _T("universe")) > 0)
ASSERT(strTest.Find(_T("world")) == -1)
And I don't know if that's a very good way of doing it.
And the problem only occurs in the current usuage (i.e. it works elsewhere in the project). But i've stepped backwards and forwards for hours and nothing else looks wrong, and nothing is there to indicate it is.
How very odd
Cheers
James Millson
p.s. Oh, and yes, I made up the actual text in the example above, but other than that it is the same. In both cases the equivalent of "world" should not be present in the string.
|
|
|
|
|
I have one VB object and one VC object.
This VB object will create one ADO Connection object.
To share the same connection, it is need to pass the connection
from VB to VC object.
Is it possible?
If yes, how can it be done?
Thanks.
|
|
|
|
|
Does anybody here know what this can be translated to in the win32 api?
AfxGetThreadState()->m_lastSentMsg;
i know it has something to do with the message queue, but i want to know what its API equivelent is
|
|
|
|
|
I image you could just declare a global MSG variable, and each time your window procedure gets called, just store the messages information.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
I use the getline function to retrieve lines from files. The problem is I have some files where lines are ended with a Carriage Return "\r" and some that are ended with a New Line "\n". How can I satisfy both without reading and checking every character?
|
|
|
|
|
Usually it's either \r\n or just \n.
What I do is totally strip any \r i come across and just
process the \n.
|
|
|
|
|
Is there a way to create a new Dao database using VC++? I know that this requires long answer, so if someone could provide a link to any help, it would be greatly apperciated.
Richard
|
|
|
|
|
yes, Using the CDaoDatabase::Create();
CDaoDatabase pdaodb;
pdaodb.Create("C:\\Mydb.mdb", dbLangGeneral, dbVersion30);
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Hi,
Would someone kindly help me out of this 6 hour long struggle.
I have an SDI app with a RichEditView. I don't need the RTF functionality, so I want to serialize text only. I've searched everywhere (even the MS Newsgroups) for a sample on how to serialize using streamin and streamout.
I understand that I have to set m_bRTF to false in order to save / load in text only, but for the life of me I can't find a sample that shows how.
An explanation or sample code would be great.
Thanks,
Frank
|
|
|
|
|
I'm not typing from much eperience here, but this is what a standard sample CMyAppWizCreatedRichEditDoc::Serialize does:
void CEditDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
}
else
{
}
CRichEditDoc::Serialize(ar);
}
CRichEditDoc::Serialize gets a pointer to the CRichEditView type object and calls serialize on that - and yes, if I don't set m_bRTF false some files fail to get read in.
If you are not using a CRichEditDoc, I would think you could fake it with a call to the view, but not sure what then happens to m_bRTF.
You can look in ...\MFC\SRC\VIEWRICH.CPP to see all the fun Stream stuff. The above code comes from the App Wizard if you select CRichEditView for your view class.
|
|
|
|
|
Thanks for the info Tim. My app is a basic appwizard generated sdi mfc app that uses RichEditDoc, and RichEditView. The serialize function in my app is exactly what you've listed in your example.
However, Where do I go from here? Ah the humanity! Where's the tylenol.
Frank
|
|
|
|
|
Hmm... I just use the Open... and Save stuff... however, I do notice that if I don't set the m_bRTF it will only show (the text of) files with the .txt extension...
Oh - and I think there's some tylenol in that white metal box with the red cross on it on top of the water cooler...
later...
CRichEditDoc::m_bRTF = FALSE;
CRichEditDoc::Serialize(ar);
|
|
|
|