|
Unfortunately, these files are located on an ftp server alone. I am not able to put them on a web server. I have no C++ NT service. Just a C++ application that i am placing a button on that says, "play video". I will figure out how to associate the file name of the video clip that i need. All i need to know is how to access that video clip and have it play in a default player.
Now, the questions that i have are :
1. Is this possible given what i said.
2. If so, what api's etc. would i use.
Thanks again,
|
|
|
|
|
LCI wrote: Just a C++ application that i am placing a button on that says, "play video".
Strange requirements and stranger application, is it a school project?
A brute force method would be to transfer the file to the local machine then launch it in the default player.
There are Windows APIs called WinInet that provide FTP client functionality. MFC has Wrapper classes for the API like CFtpConnection, CFtpFindFile, etc. There is a CodeProject article that might help you Article[^]
good luck.
|
|
|
|
|
Say i have two network cards in my system . How do i programatically get the IP address of the the second network card ?
Engineering is the effort !
|
|
|
|
|
See if this article is of any help.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I am creating SDI MFC sample App. I followed the steps given in "http://www.codeproject.com/dialog/mdisdiapps.asp". I have not yet added any of my code.
I am getting these 2 errors while compiling:
Test_SDI\MainFrm.cpp(55) :error C2065: 'CBRS_GRIPPER' : undeclared identifier
Test_SDI\MainFrm.cpp(55) :error C2660: 'CreateEx' : function does not take 3 parameters
Any suggestions?
Thanks,
Harsha
|
|
|
|
|
harsha1305 wrote: Test_SDI\MainFrm.cpp(55) :error C2065: 'CBRS_GRIPPER' : undeclared identifier
This style comes from afxres.h , which is included automatically if you used MFC's AppWizard.
What does your project's stdafx.h file look like?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi it looks like this:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__D535EB41_66D7_43B5_8D02_0D7D90278354__INCLUDED_)
#define AFX_STDAFX_H__D535EB41_66D7_43B5_8D02_0D7D90278354__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__D535EB41_66D7_43B5_8D02_0D7D90278354__INCLUDED_)
Thanks,
Harsha
|
|
|
|
|
Modify your post by surrounding the code with <pre> tags.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
What do you mean by it?
Thanks,
Harsha
|
|
|
|
|
Look at your post and see. Notice the #include directives are not showing up. I can see them if I view the HTML source, but that's unnecessary if the post was corrected.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi David,
I will correct it, but then do you think that I should include afxres.h explicitly in StdAfx.h file?
Thank you.
Harsha
|
|
|
|
|
harsha1305 wrote: do you think that I should include afxres.h explicitly in StdAfx.h file?
No. It has already been included by afxwin.h .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi all,
I set a COledateTime object:
// DateRec
COleDateTime oleDateRec;
oleDateRec.SetDateTime(anno,
mese,
giorno,
pMonitor->ore,
pMonitor->minuti,
pMonitor->secondi);
with current datetime Ex.(2006,6,20,16,50,23)
When i save oleDateRec.m_dt in a db table field with this insruction:
// Comando SQL
sSqlCommand.Format(_T("INSERT INTO STOPS_MONITOR (StopCode,DateRec,PlantCode,RoomCode,GroupCode,MachCode,CyclePos,OrderCode,StyleCode,StSize,StColor,StLot,Shift)")
_T(" VALUES(%ld,%f,'%s','%s','%s',%ld,%ld,'%s','%s','%s','%s','%s',%d)"),
lStopCode,
---> oleDateRec.m_dt,
sAffiliationPlant,
sAffiliationRoom,
sAffiliationGroup,
DbTfr.addr,
pMonitor->step,
sOrderCode,
sStyleCode,
sStSize,
sStColor,
sStLot,
atoi(tmp_Turno));
in the table STOPS_MONITOR in the field DateRec I see this: 2006, 6, 22
the day is change from 20 to 22!!!! (
Database is a MSSQL Server
the field DateRec is a datetime type. lenght 8
Any idea??
thanks in advanced!!
Too many plans make the health badly!!
|
|
|
|
|
Have you tested the SQL Statement in your DB environment? Does it work?
|
|
|
|
|
Hi again
Excuse me for asking what I am sure is a dum question, but here goes:
I have a Win32 "Typical Hello World" project VC6.0(written by others), which I am adapting to what I want to do. In my application I wish to have coloured buttons. I have previously made use of a ClrButton class in dialog boxes (which I believe I obtained from Code Guru).
If I simply include the files CClrButton.cpp & .h in my Win32 app, I come up with errors:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Can someone point me in the right direction to working out how to do this. I havnt really got a grasp of the differences in creating a dialog and a win32 app - is there a tutorial that I can look at?
Sorry for asking what I am sure are simple questions, but if you dont ask...
Cheers
Mike
|
|
|
|
|
69 Bay wrote: is there a tutorial that I can look at?
Of course, tons of them. However they may not result in you understanding things any more than the sample you worked with did. Don't get fooled into believing one can "learn C++ in 21 days". For starter books on Win32 development try Petzold and Richter. There are others as well but I liked both of them.
Programming Windows 5th Edition[^]
|
|
|
|
|
The linking errors have to do with the libraries you are linking with. Go to your Project->Settings dialog in the C/C++ tab and select the Code Generation category. You will have a combo box with choices like "DLL Singlethreaded", "DLL Multithreaded", "Singlethreaded", "Multithreaded", etc. Try selecting the Multithreaded version. If that works, look at the code and figure out why it is creating a thread ... GUI components rarely need them.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi all,
i need to set the entire rich edit text to white....
i know there is a SetBackgroundColor method and to set the text i need to do SetDefaultCharFormat
but this doesn't work for me....
here is what i do:
CHARFORMAT2 cf;
m_edtMsg.GetDefaultCharFormat(cf);
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwMask = CFM_COLOR;
cf.crTextColor = RGB(255,255,255);
m_edtMsg.SetDefaultCharFormat(cf);
when i start typing on the rich edit, i see the color hasn't been changed???
any help?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
Actually you should put cf.cbSize = sizeof(CHARFORMAT2) before GetDefaultCharFormat , but it is even unneded in case of MFC.
May be you should also unset the CFE_AUTOCOLOR :
cf.dwEffects ^= ~CFE_AUTOCOLOR;
I think you do not need to use GetDefaultCharFormat . Maybe this will work for you:
CHARFORMAT2 cf = { 0 };
cf.dwMask = CFM_COLOR;
cf.crTextColor = RGB(0, 0, 255);
m_edtMsg.SetDefaultCharFormat(cf);
Hope it helps.
|
|
|
|
|
excellent ! works like a charm! (i placed ZeroMemory instead of the CHARFORMAT2 cf = { 0 }; )
an other question if i may... i am interested on paiting the scroll bar myself of the rich edit
which message should i catch (when ever the scroll bar is shown ) to call the drawing of the scroll bar?
thanks again for all the help
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
As I know, the scroll events for rich-edit control are EN_HSCROLL and EN_VSCROLL . In order to allow these notifications, you have to set a mask in dialog’s OnInitDialog :
m_edtMsg.SetEventMask(m_edtMsg.GetEventMask() | ENM_SCROLL);
In addition the scroll bars should be enabled in the Properties panel.
If you want to change the colours of scroll bar, I think you can try the WM_CTLCOLOR or WM_CTLCOLORSCROLLBAR notifications.
If you create your own scroll-bars (for instance, derived from CScrollBar ) and put them near the edit control, then the scroll notifications will be WM_HSCROLL and WM_VSCROLL .
|
|
|
|
|
When I display the properties of a file using Explorer,
there is often a "Summary" tab, containing information
such as Title, Subject ...
How can I read and write those properties with VC++
Thanks for any help.
Peter
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
This is fine for a doc file, but it does not work for a "normal" text file.
I created a file using Notepad, and used Explorer to change the summary. I want to copy the summary information from one text file to another.
When I used the example given by Microsoft in
http://support.microsoft.com/kb/186898/EN-US,
it worked for a doc file, but complained that the text file was not a compound file.
-- modified at 5:01 Wednesday 21st June, 2006
|
|
|
|
|
petergggg wrote: This is fine for a doc file, but it does not work for a "normal" text file.
Sure it does. Just use StgOpenStorageEx() instead.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|