|
Instead of
fwrite( &TabFile, sizeof( struct STagTabFile ), 1, fpTab );
try Typecasting for void*
fwrite((const void*)TabFile, sizeof( struct STagTabFile ), 1, fpTab );
//FWRITE is
//size_t fwrite( const void *buffer, size_t size, size_t count, FILE *stream );
For FREAD
size_t fread( void *buffer, size_t size, size_t count, FILE *stream );
I hope this will help
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 0:32 Friday 14th July, 2006
|
|
|
|
|
hello,
I dont know whether u will haelp me or not......But my expectation r with u ......
I have to make connection with server which is based on london and i am working with vc++ new to this....
I have company Api with me....
I tried to take help with other friend also but luck is not good.U are my last hope....
to make connection this is a function :
I need the code to write here:
void CServertryDlg::OnConnectedToServerArielapictrl1(LPCTSTR SessionId)
{
// TODO: Add your control notification handler code here
}
Pls. if u can help me to make connection i am really thankful to you.
priyanka
api/vc++
|
|
|
|
|
What type of connection do you need (TCP or UDP)? Are you supposed to be initiating the connection, or are you already connected at this point (since the function is called OnConnectedToServer) and you have to write some code to handle the connection? A little more info about what exactly you need to do would allow us to answer your question much more effectively.
Kelly Ryan
|
|
|
|
|
//need to make tcp connection
//atleast code for these to start
void CServertryDlg::OnConnectedToServerArielapictrl1(LPCTSTR SessionId)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnLoginArielapictrl1(LPCTSTR SessionId, short Accepted, LPCTSTR FailureMessage)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnAccountListArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, LPCTSTR Name, short TradePermissions)
{
// TODO: Add your control notification handler code here
}
|
|
|
|
|
google sockets API and windows. Plenty of sample code.
earl
|
|
|
|
|
i already but lots of confusion:
|
|
|
|
|
Just try something yourself, post your doubts when you get stuck somewhere. Then all can help you better.
Good Luck...
|
|
|
|
|
(1) kindly stop spamming the forums -- you've posted a nearly identical post at least 4 times
(2) do some work yourself. Here[^] is but one of many pages. Go read it, compile the sample programs, make them run, then write some code.
earl
|
|
|
|
|
Dear c++ friends,
CString sBuf;
int nchar;
nchar = sBuf.GetLength()- 20;
if (sBuf.GetLength() > 20)
sBuf = sBuf.Left(20);
else //to make the length 20
sBuf = sBuf + SPACE(nchar); //error in this statement
Thanks and regards,
Joy Anne
|
|
|
|
|
Hi,
Looks like SPACE is a user defined function.What is the error ? and is the SPACE defined ?
Thanks
|
|
|
|
|
Try
sBuf.Insert( nIndex, ' ' );
Here space will be inserted at nIndex'th position of the string.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Firstly if nchar is what you're using to determine how many spaces you need to add, you need to reverse your logic there, it should be:
nchar = 20 - sBuf.GetLength();
Rather than the other way around.
Now if you're thinking of the Space method from Visual Basic, C++ doesn't have that same method. You could however quickly write something up yourself using Insert as another poster mentioned. For instance:
int i = 0, len = sBuf.GetLength();
while (i < nchar)
{
sBuf.Insert(len + i, ' ');
i++;
}
Kelly Ryan
|
|
|
|
|
I am a beginner in MFC. I want to ask if tab control can join two project together? and how can i do it?
thx a lot.
|
|
|
|
|
Can you tell some thing about ur requirement..
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
I only want to join two project together but use the same dlg.
|
|
|
|
|
which projects? and in which dlg?
Regards
Abhishake Lahare
|
|
|
|
|
Hihi, just one quick question:
I have a multi-column listbox that I insert bitmaps into. I want it to have a max of 8 columns, and have an essentially unlimited number of rows. Right now it seems to limit number of rows by the listbox height (i.e. my vertical scrollbar never shows up because it refuses to insert items below the bottom of the listbox), and have an unlimited number of columns. How can I fix this so that the columns are limited and the rows are not?
Thanks!
Kelly Ryan
|
|
|
|
|
The Items might get inserted in row, but you may not able to scroll the list,
check if you have LBS_DISABLENOSCROLL style that may be causing problem.
Regards
Abhishake Lahare
-- modified at 23:36 Thursday 13th July, 2006
|
|
|
|
|
LBS_DISABLENOSCROLL is not set, the items are all inserted but only into the rows that 'fit' into the height of the listbox, all the other items are inserted in the columns. I just need a way to limit the number of columns somehow or force it to insert in rows after it has X number of columns.
Kelly Ryan
|
|
|
|
|
How are you inserting items in listbox. can you paste code which is causing problem
Regards
Abhishake Lahare
|
|
|
|
|
I'm just using LB_INSERTSTRING, like so:
HBITMAP hbmp;
hbmp = <whatever bitmap="" i'm="" inserting="" here="">
SendMessage(window, LB_INSERTSTRING, (WPARAM)item_index, (LPARAM)hbmp);
I don't know that it's a problem so much as just a default behavior, but I can't figure out how to change it and I need vertical scrolling on this list rather than horizontal, but I need multiple columns. I don't want to have to go and write a custom class to do this, there should be a simple way to just limit the # of columns, I hope..
Here's a diagram of the problem:
Assuming the listbox height is '3 items' this is what it currently does, even when the listbox width is only '5 items':
A A A A A A A A A A A A
A A A A A A A A A A A A
A A A A A A A A A A
What I WANT it to do is this:
A A A A A
A A A A A
A A A A A
A A A A A
A A A A A
A A A A A
A A A A
Where it shows the top 3 rows and the user has to scroll down to see the rest.
If there was some sort of windows message to set # of columns, or something? I've been looking but I can't seem to find one..
|
|
|
|
|
KellyR wrote: How can I fix this so that the columns are limited and the rows are not?
Unfortunately, you can't with a list box. All you can do is set the column width, which is not what you want.
KellyR wrote: I have a multi-column listbox that I insert bitmaps into. I want it to have a max of 8 columns, and have an essentially unlimited number of rows.
So your list-box items are bitmaps? You could try using a grid control, or a list-view control with the LVS_ICON view style - just set the icon size and spacing such that you have the correct number of columns in each row.
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"
|
|
|
|
|
I was thinking about using LVS_ICON when I made the thing but I was hoping it wouldn't matter.. darn it. I'll give that a shot, thanks for help!
Kelly Ryan
|
|
|
|
|
Hey all,
Finally, I managed to come up with a code snippet for WM_TIMER.
I have to send a packet from PC to the serial device(RABIT3000) at regular intervals 'x'seconds.
heres the code
On_begin()
{
Sendpacket();
SetTimer(m_nTimerID,x,NULL);
}
OnTimer(UINT nIDEvent)
{
// do the needful
Sendpacket();
CWnd::OnTimer(nIDEvent);
}
On_Stop()
{
KillTimer(m_nTimerID);
}
IS this correct? What more do I need to do? Where do I declare like "afx_msg void OnTimer(...)?
Thanks in advance.
|
|
|
|
|
You need to call ON_WM_TIMER() message in BEGIN_MESSAGE_MAP
and also declare
afx_msg void OnTimer(UINT nIDEvent);
in header of class
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|