|
it's fine that you are having an API with which you have to connect to a server.But you forgot to mention about 1) - with what protocol do you want to connect and provide some details of the application.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
tcp protocol
Get connected to london server,get session ID,port no:1000.
void CServertryDlg::OnLoginArielapictrl1(LPCTSTR SessionId, short Accepted, LPCTSTR FailureMessage)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnConnectedToServerArielapictrl1(LPCTSTR SessionId)
{
// 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
}
thanks for your kind reply
|
|
|
|
|
THIS ARE ALL THE API FUNCTION FOR WHICH I NEED THE CODE.IF ANY ONE CAN HELP ME TO U...PLEASE...U R MY LAST HOPE ...I AM NEW TO PROGRAMMING....AND THIS ASSIGNMENT IS MY LIFE SAVING OXYGEN......
void CServertryDlg::OnLoginArielapictrl1(LPCTSTR SessionId, short Accepted, LPCTSTR FailureMessage)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnConnectedToServerArielapictrl1(LPCTSTR SessionId)
{
// 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
}
void CServertryDlg::OnDealAcceptedArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short Accepted, LPCTSTR DealerMessage, LPCTSTR AcceptTime, long DealNumber, LPCTSTR Price, LPCTSTR CashPrice)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnListChangedArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnPriceQuoteArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, LPCTSTR Price, short Timeout)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market, LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnDealerAllocatedArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, LPCTSTR DealerName)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnDealerHeldArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, LPCTSTR Message)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnDealerInterruptArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnOrderListArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, long OrderNumber, LPCTSTR Amount, LPCTSTR Market, short BuySell, short StopLimit, LPCTSTR RequestPrice, LPCTSTR CurrentPrice, short TradeType, LPCTSTR Exchange, short GoodTil, LPCTSTR GoodTilTime, LPCTSTR Instructions, LPCTSTR CreationTime, LPCTSTR AmendmentTime, LPCTSTR ExecutionTime, LPCTSTR DealerName, LPCTSTR Account, LPCTSTR ClientRef)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnOrderAcceptedArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short Accepted, LPCTSTR DealerMessage, long OrderNumber)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnItemChangedArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, LPCTSTR Ref, short ChangeType)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnEndOfListArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnQuoteExpiredArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnServerResponseTimeArielapictrl1(LPCTSTR SessionId, long Time)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnServerTimeArielapictrl1(LPCTSTR SessionId, LPCTSTR Time)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnStatusMessageArielapictrl1(LPCTSTR SessionId, LPCTSTR Message)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnTradeHistoryArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, LPCTSTR DealNumber, LPCTSTR Market, LPCTSTR Amount, LPCTSTR Price, short BuySell, short TradeType, LPCTSTR Exchange, LPCTSTR CashPrice, LPCTSTR DealerName, LPCTSTR Time, LPCTSTR Account, LPCTSTR ClientRef)
{
// TODO: Add your control notification handler code here
}
void CServertryDlg::OnLostConnectionArielapictrl1(LPCTSTR SessionId)
{
// TODO: Add your control notification handler code here
}
|
|
|
|
|
Ask a problem,about inheritance
****************static DLL*****************
<<<<<<<<<cmview.h>>>>>>>>>>>
#pragma once
class AFX_NOVTABLE CmView :public CView
{
public:
__declspec(dllexport) CmView();
};
<<<<<<<<<cmview.cpp>>>>>>>>
#include "stdafx.h"
#include "CmView.h"
CmView::CmView()
{
}
******************static EXE******************
<<<<<<<<exeview.h>>>>>>>>>
#pragma once
#include "CmView.h"
#pragma comment(lib,"dll.lib")
class EXEView : public CmView
{
...........
};
<<<<<<<<<exeview.cpp>>>>>>>>>
#include "stdafx.h"
#include "EXEView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNCREATE(CInfoEngineView, CmView)
.......................
error:
error C2039: 'classCmView' : is not a member of 'CmView'
see declaration of 'CmView'
error C2065: 'classCmView' : undeclared identifier
why......
thank you
|
|
|
|
|
Why on earth are you declaring a C++ member function to be exported from a dll? If you just want a particular calling convention, say so, though perhaps member functions require __thiscall. However, unless it's just late and I'm being stupid, you can't call anything but a static member function from a dll because it's missing the this pointer.
I assume that the CView object code is in dll.lib? Can you instantiate CmView?
earl
|
|
|
|
|
I have a problem in file reading.When i write to the file,it writes very correct.but during reading it doesn't read anything.
e.g,I have to write some details of SWFLOW,SWT,VCOn,STEMP etc.,the code for writing
struct STagTabFile TabFile;
CDisplay *pTemp;
FILE *fpTab;
if( (fpTab = fopen( szFileName, "w" )) == NULL )
{
MessageBox( "Unable to open" );
return FALSE;
}
for( POSITION indx = DisplayList.FindIndex( GetTopIndex(ActivePage) ); indx != NULL; )
{
pTemp = (CDisplay *) DisplayList.GetAt( indx );
strcpy( TabFile.VarName, (LPCTSTR)pTemp->DisVar );
TabFile.OffSet = pTemp->OffSet;
fwrite( &TabFile, sizeof( struct STagTabFile ), 1, fpTab );
DisplayList.GetNext( indx );
}
fclose( fpTab );
return TRUE;
}
FOr reading,
if( (fpTab = fopen( szFileName, "r" )) == NULL )
{
MessageBox( "Unable to open " );return FALSE;
}
while( fread( &TabFile, sizeof( struct STagTabFile ), 1, fpTab ) )
{
if( ( DisplayBuf = new CDisplay() ) == NULL )
{
MessageBox( "Out Of Memory" );return FALSE;
}
DisplayBuf->DisVar = (CString)TabFile.VarName;
DisplayBuf->OffSet = TabFile.OffSet;
DisplayList.AddTail( DisplayBuf );
PutDataInScreen( DisplayBuf );
} fclose( fpTab );
This is my coding,when i read the values for SWFLOW,SWT,VCON and all other it reads the value perfectly.
In case of STEMP it does not enter in to while loop,it comes out.Whats the reason,if there is any mistake in my coding means it should not read for all variables,but it reads for all variables except STEMP.wats the reason?
|
|
|
|
|
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
|
|
|
|
|