|
My problem is How to start interrupted detection process again.
thanks in advance
|
|
|
|
|
What is an "interrupted detection process"?
|
|
|
|
|
|
This is the C++/CLI forum meant for managed and mixed-mode topics.
Your thread should ideally have been here:
http://www.codeproject.com/Forums/1647/C-Cplusplus-MFC.aspx[^]
That said, if you look at his code, specially the GetSession and DownloadFile methods, you'll see that he downloads the file using InternetOpenUrl and InternetReadFile .
|
|
|
|
|
sorry, I'll just move my question then. thanks for the guide.
|
|
|
|
|
I am working from a book that has me make a simple Paint program on an MFC SDI. It uses a metafile to store the GDI. I can save the metafile to disk, open the metafile from disk, but the book does not show me how to print the metafile to a printer. If I try to preview or print the document, I get a blank document.
I am saving the metafile this way...
void CPainterView::OnFileSave()
{
CPainterDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
HMETAFILE MetaFileHandle = pDoc->pMetaFileDC->Close();
CopyMetaFile(MetaFileHandle, "painter.wmf");
CMetaFileDC* ReplacementMetaFile = new CMetaFileDC();
ReplacementMetaFile->Create();
ReplacementMetaFile->PlayMetaFile(MetaFileHandle);
DeleteMetaFile(MetaFileHandle);
delete pDoc->pMetaFileDC;
pDoc->pMetaFileDC = ReplacementMetaFile;
}
I showed you how the book saves the metafile because I have a feeling printing will be very similar.
With the MFC SDI, I have the print features...
BOOL CPainterView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPainterView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CPainterView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
Can I use any of these print features to print my metafile? Thank you
modified on Thursday, October 21, 2010 1:36 AM
|
|
|
|
|
|
Hi,
I am using Visual studio 2005 to build a small Win32 .exe. This exe is doing a very small registry operation only. So i do not want a UI for this. I tried to do a win 32 console application. but while launching that the command console pops up for a moment till the execution completes.
How to build the exe where the console will not pop up?
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
I am not sure how you can do that, if it's a console application then it needs to execute in a console Window.
By the way this is not a Managed C++/CLI question; please use the correct forum for your queries.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Richard MacCutchan wrote: By the way this is not a Managed C++/CLI question; please use the correct forum for your queries.
Thank you, take a 5!
|
|
|
|
|
Thanks, I do think this has been getting worse recently, which is quite worrying when you consider what the levels of ability, initiative, etc. of people on these forums should be.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
birajendu wrote: How to build the exe where the console will not pop up?
Just choose a normal Win32 project (not a console project) and just don't put any code that creates a window.
|
|
|
|
|
Hi,
I would like to write a utility which will clear all those registry entries which has a particular sub string (e.g "mycompany").
So to achieve this I think i need to implement some logic which will check all those registry paths having keys which contain string/sub string "mycompany". I am trying to find out is there any API like FindNextFile() or some thing like that for registry keys.
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
birajendu wrote: is there any API
Yes, it's all here[^] in MSDN; something you should familiarise yourself with.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
hi,i am trying to use arrays to read text from a file on another location before sending it out byte by byte but i not very familiar with using arrays for my coding,so if you could do help me correct my coding.
void loop()
{
char Msg[]={"Hello"};
char *start;
int i=0;
if(!BT.createConnection("0017E5F1CD3B","02")) {
USB.println("");
USB.print("--- CONNECTION -- MTU: ");
USB.print(BT.connection_mtu[0],BYTE); USB.print(BT.connection_mtu[1],BYTE);
USB.println(BT.connection_mtu[2],BYTE);
}
else USB.println("Connection failed");
start=Msg;
if(USB.println("Data sent OK");
else USB.println("Error while sending data");
if(!BT.removeConnection()) USB.println("Connection removed");
else USB.println("Error while removing connection");
if(!BT.removeTrustedDevice("0017E5F1CD3B")) USB.println("Trusted Device removed");
else USB.println("Error while removing trusted device");
BT.OFF();
}
|
|
|
|
|
I don't see anything in the above referring to reading (or even opening) a file. You have the line start=Msg; half way down your code but you never do anything with either variable; what is their purpose?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
thanks for the prompt reply.If i were to use array to read a file from a location and send it byte by byte,how should i do it?
|
|
|
|
|
rezen85 wrote: If i were to use array to read a file from a location and send it byte by byte,how should i do it?
Well the question almost answers itself. Firstly, you will always read into an array, unless you are reading the file byte by byte (or using some other elementary type). Secondly, once you have the data in your array it is simply a matter of iterating through it and processing each byte as required. Take a look at fstream[^], CreateFile[^] and associated functions (if Windows), or fopen[^] etc., for reading files.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
|
|
Application crashes at RichEditCtrl.StremOut(), It says attempt to read write protected memory. this often an indication that the other memory is corrupt.
May I know some path to find the issue and fix the issue. Any idea ?
|
|
|
|
|
Check the parameters in your code including your streamout callback routine. You could post a copy here for others to review.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Sorry here it is :
.....
if (0 != file.Open(m_str, CFile::modeCreate | CFile::modeWrite, &e))
{
EDITSTREAM es = {0};
es.pfnCallback = COleElement::CallFunction;
es.dwError = 0;
es.dwCookie = (DWORD)&file;
lRet = m_cRichEdCt.StreamOut(SF_RTF, es);
}
..........
DWORD CALLBACK CMyClass::CallFunction(DWORD dwCookie, LPBYTE lpBuf,LONG nCount, LONG* Write)
{
CFile* pFile = (CFile*)dwCookie;
if (pFile)
{
pFile->Write(lpBuf, nCount);
}
*Write = nCount;
return 0;
}
|
|
|
|