|
Your code keeps a file open for it's entire lifetime ?
Have you tried stepping through the code in a debugger, to see which line is causing your error ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
wasife wrote:
UpdateData(TRUE);
Don't use UpdateData() . See here for details.
wasife wrote:
if(m_strLoginName.GetLength()!=5)
Checking the length is unnecessary. Use CEdit::SetLimitText() instead.
wasife wrote:
MessageBox("Login Name must be exactly 5 characters long","Stop",MB_ICONSTOP|MB_OK);
You might consider AfxMessageBox() here, unless you really need a custom caption.
wasife wrote:
m_pPSWFile->Read(&login,5);
The first parameter to Read() is a void* not a CString* . You'll need something like:
LPSTR lpBuffer = login.GetBuffer(5);
m_pPSWFile->Read(lpBuffer, 5);
login.ReleaseBuffer(5); Now login contains the five bytes read from the file.
As far as the error(s) you are getting, I suggest stepping through each statement in the debugger to see which one is at fault.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
Don't use UpdateData().
don't use knives, ever. they have two features that makes them extremely dangerous: their sharp points, and their sharp edges. either of those features could cause a lot of pain and/or damage, if pressed into, or sliced across, your nose.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
I hope that my Windows client program searches all IP devices on same network and then gets MAC addresses of those.
These IP devices are based on LINUX and the client program should be run on all versions of Windows.
In my thought, this is possible by getting the individual IP of all devices, drawing the MAC address from that IP
and checking if the MAC is in particular range which we need.
First step, the way to getting IPs of all devices on network, may be following.
1) broadcasting to all devices on network
2) using WNetEnumResource
I have not tried 1)way, so I wonder what part of the data from the device has the information of IP.
And I think 2)way has no problem.
Second step, the way to drawing MAC address, may be following.
1) using NetBios()
2) using SendARP()
3) using WinPcap library
Though I tried 1)way, NetBios() can draw only MAC of own PC that my Windows client runs.
2)way is possible on only Windows 2000, Xp, so this way is not proper for me.
3)way is may be possible, But, bucause I think I should program ARP protocol, it will be difficult.
Or, is there any easier way and solution to do those two steps except my thoughts?
And, is there any problem or error of my thoughts?
Please give me advices.
Have a nice day!
|
|
|
|
|
The third way is not impossible.. it's the best way!
Send a broadcast ping packet, receive the answers with the winpcap and extract the mac addresses from it. That should be very easy!
Don't try it, just do it!
|
|
|
|
|
i wrote an dialog based application. now i want to create a setup file for it. any ideas????????
|
|
|
|
|
check out NSIS, made by Nullsoft, the Winamp people. I haven't used it personally, but I bet it's pretty easy to learn and powerful because it's a pretty widely used free installer.
|
|
|
|
|
If you only want to create a setup file for your application , you can use the tools about setup , e.g "Installer VISE" . If you want to write a tool about setup , you should to have a long about step to step base of dialog .
e.g
http://www.vckbase.com/code/listcode.asp?mclsid=3&sclsid=317[^]
sorry for my poor english .
|
|
|
|
|
|
I'm working to let the program know the column No. which user right-clicked the ListView in the HeadCtrl area. There is HitTest() method in CListCtrl class to determine the item No. for a given position, but I can not find the same way in CHeadCtrl.
Can anybody tell me what should I do?
Lisoft
|
|
|
|
|
\\.........
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnClick)
\\.........
void CSortListCtrl::OnColumnClick( NMHDR* pNMHDR, LRESULT* pResult )
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
const int iColumn = pNMListView->iSubItem;
*pResult = 0;
}
|
|
|
|
|
Hi,I have made a single document MFC application in VC++, in which several items may be drawn using toolbar(same as MS paint).But the problem is here: I want to make one of the items in such a way that when a user draws (selecting from toolbar)it in drawable area and clicks or double clicks (preferrable if double right click is implemented)on it, another document opens in which the user can also draw using the toolbar as it occurs for the root document.Here also if the specified tool is selected from toolbar and drawn in the child document (i.e. drawable area ) and double right clicked it opens another child document of it and so on..
Again ,if saved ,all the documents (i.e. main document,child document,next child document,...) must be saved and when opened the main document ,it should take care of the rest i.e. when double right clicked on the specified item which was drawn,the corresponding child document should be opened from repository and so on..
There may be several such item drawn in a single document.Is it possible not to open the child documents from repository?
How could I do the above? Please help me step by step.
|
|
|
|
|
I have a function declared like this: bool CSerialControl::DoCommPackage (DWORD dwBlockTime, void *lpvOutputData, unsigned int uiOutputLength, void *lpvIncoming, unsigned int uiExpectedInputLength) { ... }
When I call the function, I have this:
char buf[70];<br />
if (classData->m_serialPort->DoCommPackage(INFINITE, NULL, 0, buf, 70)) { ... do something useful ... }
It gets the right return value, true under the proper circumstances, and does something useful, but in the useful part, the buf character array is unchanged from when it was allocated before the if statement. I don't get why it's unchanged, am I missing something or what? Thanks, Nate.
|
|
|
|
|
bool CSerialControl::DoCommPackage (DWORD dwBlockTime, void *lpvOutputData, unsigned int uiOutputLength, void *lpvIncoming, unsigned int uiExpectedInputLength){
char * p = (char *)lpvIncoming ;
//lpvIncoming is replaced by p
}
e.g
int FuncA(void * lp , int iCount )
{
char * p = (char *)lp;
memset(p,0,iCount);
strcpy(p,"this is a test");
return 1 ;
}
...............................
char str[70];
FuncA(str,70);
|
|
|
|
|
thanks, didn't know I had to recast it, thought I could just assign the pointer to the data to the pointer to the output and be done with it.
|
|
|
|
|
Is there any library to generate gantt charts?
|
|
|
|
|
I did a search a while ago.
The closest i found was:
http://ganttproject.sourceforge.net/[^]
It's an open source java app for project management.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
thanks!
|
|
|
|
|
hi every one. I've got this problem for a long time, but have not find a solution.
any one help me!!!.
I want to detect an other Computer on my Local Network are accessing my Computer, and make a warning ...
waiting a reply....
thanks
|
|
|
|
|
Hello, I'd like to know how i can insert the current date and time into a CRecordset table(SQL Server) , I need to insert the date of the server not the one of the computer. I think the getdate() function from sql might work and how?
|
|
|
|
|
jmbz84 wrote:
I think the getdate() function from sql might work and how?
It might work. Try set the default value as getdate() .
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
SQL "insert into table(aa) values(getdate()) " .
|
|
|
|
|
|
Michael Dunn wrote:
SHMessageBoxCheck
As long as you don't have to support anything prior to Win2k...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|