|
Thanx Chris!
I´ll guess that I have to search and make a list or table of all zero byte files found in the directory, in order to then delete them.
Do you have a nice codesample that shows how to do it?
/Peter
|
|
|
|
|
You don't need a list, just use the sample code in MSDN to iterate through files and then delete them as you find them, unless you want to offer a user prompt.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Thank you Christian, for your seuggestion.
I will try that!
|
|
|
|
|
how to set the pane frame size explicitly depending on the screen size?
|
|
|
|
|
Use CSplitterWnd::SetRowInfo & SetColumInfo to set the minimun and
required sizes for the pane.
|
|
|
|
|
how (where)to code a sw to be portable across win 95,98 and 2000.
will any compromises have to be made wrt UI or normal stl logic?
Ross
|
|
|
|
|
there won't be any STL issues, as STL is a compiler thing, not an OS thing.
i've never had any UI issues. just stick to the basics and you'll be fine.
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
what about the memory allocations and mapping modes.I heard the approach is different between 95/98 and NT.isn't 2000 similar to NT.
Ross
|
|
|
|
|
If you write code using VC6, it will run fine on W95/98/etc. It's only if you use features that were introduced later that you run into problems. I've never see any problems with memory allocations or mapping modes. Mapping to what ?
W2000 is NT5. It was MEANT to be be what XP is, a merging of the two streams. Win ME was and is an abortion.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
|
It's probable that NT offered different mapping modes, GDI changes a lot between releases of windows, but do you really think they would release a new version of windows that does not run all the software written before for previous versions ? Who would buy it ?
Don't install any SDK's if you're targeting W95, otherwise just read the docs and test often on your lowest platform. Testing on the others does not hurt, but it's wrong to think that you need to write two versions or do some magic, I think everything I ever wrote has run under W98 and the NT stream, unless I used features that limited it to W2000+.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
hi,
I have 1 problem and 1 doubt.
Problem.
I have to extract the text from a CEditView and parse it and fill some structure for calculation.I use the embedded control to get the text using a char array of some size.My data file format is something like this
/Comments
[tag]
123
234
345
[tag]
/comments
The problem is this.
When I read the first line,the array is filled with '/Comments.'
When I read the second line, the array is filled with
'[tag]ents'
When I read the actual data line,the array is filled with
'123mments'.
I cant parse.I cant parse even with the data ending with a semicolon.
How to solve this.Can memset,ing the array with 0's help?
Doubt:
To set multiple lines of text,is doing something like this the only way?
const char multLine[] =
"line1"
"\r\n"
"line2"
"\r\n";
GetEditCtrl().SetWindowText(multLine);
Goran Dokic
|
|
|
|
|
The way you're setting the text is right, and you have the answer, if you're iterating through and the null is not being set, set it yourself.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Okay, I know I'm horribly below all of you as far as skill level, but I'm having a very strange problem with a function not being called. It's inside a while loop, though- is that a problem?
|
|
|
|
|
A do-while function will get called once, no matter what. Otherwise, it will NEVER get called if the while statement evaluates to false.
while(false)
{
// we never get here
};
do
{
// This will run once
} while (false);
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
If you post the code you'll get a very quick answer.
Regards,
Brian Dela
|
|
|
|
|
What is the correct way to read and write raw data to and from an access database from c++. The field is a Ole Object in the database.
The table has two fields in it
1) type -- long
2) data -- Ole Variant
CDaoDatabase db;
CDaoRecordset recset(&db);
db.Open("data.mdb");
recset.Open(AFX_DAO_USE_DEFAULT_TYPE, "SELECT * FROM Main" ,NULL);
recset.AddNew();
recset.SetFieldValue("Type", (long)1);
BYTE* pInfo;
pInfo = new BYTE [30];
for(int i = 0; i < 30; i++)
pInfo[i] = i;
recset.Update();
recset.Close();
db.Close();
How do i get the data from pInfo into the the field "data" in the database?
this data could be anything from a bitmap to text.
thanks
|
|
|
|
|
Use void SetFieldValue( LPCTSTR lpszName, const COleVariant& varValue );
1. Put the byte array into a safearray of type VT_U1
2. Embed the array in a variant
3. Pass it to the above function
|
|
|
|
|
I hope you all've used MSN messenger. The window/GUI of MSN messenger is customizable and there are many custom add-ons present. I mean that we can customize the window of MSN messenger without having the access to the original source code.
I also want to make my window based application that i can customize later without accessing the original source code, just like MSN messenger. Can any one tell me how such applications are created ???
|
|
|
|
|
I am having a problem with a Combobox that I have on a dialog. I am attempting to populate the ComboBox from records in a mdb database. I can get the recordset open just fine and when I attempt to put the items into the ComboBox I get one of two errors:
CB_ERR or CB_ERRSPACE
I have tried using both AddString and InsertString and I get the same errors. I am only attempting to insert about 5 items currently. I have tried to allocate space using the InitStorage method and I can only get about 10 bytes allocated.
My systems has 512MB of Ram and has about 61% of systems resources available.
Here is the code snipet for the getting the data in from the recordset:
<br />
if(!rsLocation.Open())<br />
MessageBox(_T("Error opening the Locations Table!"), _T("Initialization Error"), MB_ICONEXCLAMATION);<br />
else<br />
{<br />
while(!rsLocation.IsEOF())<br />
{<br />
CString strLocation = rsLocation.m_LocationName;<br />
if(m_cLocation.AddString(strLocation) == CB_ERR || CB_ERRSPACE)<br />
{<br />
MessageBox(_T("Error adding locations!"), _T("Initialization Error"), MB_ICONEXCLAMATION);<br />
break;<br />
}<br />
else<br />
{<br />
rsLocation.MoveNext();<br />
nRowNum++;<br />
}<br />
}<br />
rsLocation.Close();<br />
}<br />
Any ideas why this fails?
Thanks,
-Eric
|
|
|
|
|
I am trying to implement window snapping in an SDI application. The code I'm using (http://www4.ncsu.edu/~jgbishop/codetips/snapwindow.html) works fine when I place it in the CMainFrame class. However, I allow the user to set a custom snap distance. This is done via the options dialog, which is opened from my CFormView class.
My main problem is that I cannot seem to access this needed CFormView variable from my CMainFrame class. If I could do that, things would work like I want them to. Anyone know how to do that?
If that is not possible, is there some way to trap messages sent to the CMainFrame in my CFormView class? Perhaps some sort of message routing mechanism that I could use? I need to trap the WM_MOVING and WM_ENTERSIZEMOVE events for my SDI application window, but it seems that I can only do that from the CMainFrame class (not from CFormView).
If anyone has a solution to either of these problems, I would be very grateful!
Jonah Bishop
Visit JGB Productions
http://www4.ncsu.edu/~jgbishop
|
|
|
|
|
Store the snap distance in CMainFrame and make a public accessor SetSnapDistance() . The view can then call
((CMainFrame*) AfxGetMainWnd())->SetSnapDistance(new_distance);
as needed.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanks Michael! This is just what I needed...
Jonah B.
Jonah Bishop
Visit JGB Productions
http://www4.ncsu.edu/~jgbishop
|
|
|
|
|
hi all,
i want to know the result or problem if i access same function with 2 threads as following
class A
{
public:
A()
{
AfxBeginThread(threadA, this...);
AfxBeginThread(threadB, this...);
}
static uint threadA(LPVOID ptr)
{
A* pA = (A*) ptr;
pA->commandfunction();
}
static uint threadB(LPVOID ptr)
{
A* pA = (A*) ptr;
pA->commandfunction();
}
void commonfunction()
{ ... }
}
int main()
{
A a;
}
what will happen if threadA, threadB access commonfunction() at the same time?
as i know, they should access same copy of commonfunction().
will there any corruption?
pls give me some idea!
thanks,
jim
|
|
|
|
|
Each thread has one copy of the stack, so if depends of what you do in the common function, if you access a global or static (I don't recommend these 2 approaches) variable, then yes , you could have troubles , if you access a shareable variable that is updated based on some common work, let's say a inserting/removing elements of the queue , then you also should protect it , to prevent data corruption/race conditions ...
If you want to pass data to the function is normal to pass a struct with the data that you want to access, plus a condition variable or a mutex(interprocess visibility) to protect your access to it ...
HTH
Cheers,Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary.-Shog9
Remember just because a good thing comes to an end, doesn't mean that the next one can't be better.-Chris Meech
|
|
|
|
|