|
All Right.... Thanks guys
Best Regards
|
|
|
|
|
Can I read a file which is already opened for writing????
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
If I am not wrong,
Unless u close the handle ,u cannot open the same file again.
If u want to read and write at the same time use flags like CFile::modeReadWrite
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Thats i know.
My problem is that this file is opened for write by another application. I have no information about this application.
I want to read it from my application.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Then to my knowledge,it is not possible to read .
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
It all depends on the share mode used to open the file. If the other application opened the file with READ access and using FILE_SHARE_READ, then you can read the file. Try opening the file with the same and see what happens.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I made the file association of my file type with my application, and now when I double click the file, it opens my application but gives the error message
"Windows cannot find 'c:\downloads\file.hs1'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search."
The file path is shows is the file I just clicked, so it obviously exists.
what i have to do.
|
|
|
|
|
hi
i use slider control and i use its code in oninitdialog
iset m_slider.SetRange(0,8); its range it works
but when i want to set selection with this m_slider.SetSelection(3,7); it does not works plz solve this one
thanks
Ashish Dogra
MCA
Noida
|
|
|
|
|
Have you selected the EnableSelection property of Slider conrol?
|
|
|
|
|
thanks to u reply.
i have a list of function on which i have to wirte code:
Is it possible that i can mail u so that send u some attachment...regarding api
First i have to get connected to server...
Functions are:
1.login
2.getconnected to srever.
3. so on
|
|
|
|
|
//need code for this
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
}
port no:1000
|
|
|
|
|
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
|
|
|
|
|