|
Hi,
If I create a tempfile with _open (_sopen) and _O_TEMPORARY-flag I can write to this file but I hav'nt access from an other application. Here the complete Code:
int fh = _sopen ("tempfile.ext", _O_BINARY | _O_RDWR | _O_CREAT | _O_TEMPORARY, _SH_DENYNO, _S_IREAD | _S_IWRITE);
int written = _write (fh, (void *) buffer, sizeof (buffer));
StartApplication ("tempfile.exe");
_close (fh);
Is anybody out there with an solution? I hoped, if I close my 2nd Application (he should open the tempfile for read), the system delete my tempfile automaticly.
Stephan
|
|
|
|
|
I have a code statements:
vect<cstring> strs("ddd");
find(strs.begin(), strs.end(), strs);
Building message:
error C2440: '=' : cannot convert from 'const class CString *' to 'class CString *'
|
|
|
|
|
1. what is a "vect" ?
2. what line does the error message refer to?
-c
Green's Law of Debate:
Anything is possible if you don't know what you're talking about.
|
|
|
|
|
Chris Losinger wrote:
1. what is a "vect" ?
Chris,
It looks like he migh have done something like this, maybe??:
typedef vector<CString> vect;
error C2440: '=' : cannot convert from 'const class CString *' to 'class CString *'
Could you be having a problem with a copy constructor or do you not have to deal with those when working with the CString 's?
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
try
find(strs.begin(), strs.end(), CString("ddd"));
Todd Smith
|
|
|
|
|
Can anyone tell me how to programatically delete the file. Can this be achieved via CFile ???
|
|
|
|
|
Use DeleteFile , for instance.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Cfile::Remove
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi!
I'm looking for creating a program in which I would like to add a dialog which contains a Html Edit Control like the one we can get by using the Document/View architecture with the CHtmlEditDoc class as the Document Class.
Here a portion of my code:
BOOL CHTMLCDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CHtmlEditCtrl m_HtmlEdit;
m_HtmlEdit.Create ("",0, CRect (0,0,100,100), this, 1);
....
I get the following error:
error C2248: 'CHtmlEditCtrl::~CHtmlEditCtrl' : cannot access protected member declared in class 'CHtmlEditCtrl'
Does anyone could help me?
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
Ummm. It's strange that the dtor is protected, but nevertheless you're doing it wrong, since in this case the control should be dynamically allocated:
BOOL CHTMLCDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CHtmlEditCtrl* m_HtmlEdit=new CHtmlEditCtrl();
m_HtmlEdit->Create ("",0, CRect (0,0,100,100), this, 1);
....
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I don't know about your CHtmlEditCtrl (???) but I've tried this with CHtmlView and it works very nice. CHtmlView (like all CView's has the constructor protected)
//in your OnInitDialog
CHtmlView *pView ;
CRuntimeClass *pRtClass = RUNTIME_CLASS(CHtmlView);
pView = (CHtmlView *) pRtClass->CreateObject();
pView->Create(NULL, NULL, WS_VISIBLE | WS_CHILD, rct, this, IDC_STATIC_CTRL);
pView->Navigate2(_T("www.microsoft.com"));
Romeo JUNCU
|
|
|
|
|
Thks, the code is working now.
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
How can I edit a ListItem in a MFC CListCtrl. I know that i should place a Edit-Box. But on which position?
How can I get the Position for the EditBox?
|
|
|
|
|
No, you don't create your own edit box. Handle the LVN_BEGINLABELEDIT and LVN_ENDLABELEDIT notifications.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Do you have a sample-code?
|
|
|
|
|
What do you mean edit an item? Do you mean change an item if the user clicks on it?
For example, if the user double clicks an item, you could create a dialog box with the item's current data and allow the user to change it.
Kuphryn
|
|
|
|
|
In our very own List Control articles section, there is an article on Editing Sub-Items in List Control by s.prabhakarreddy. You may find it useful...
Shog9
------
And on the pedestal, these words appear:
"My name is Ozymandias, King of Kings,
Look on my Works, ye Mighty, and despair!"
Nothing beside remains.
|
|
|
|
|
I am having a problem with getting an animation to be displayed with a transparent background. I have a C++ based application (no MFC) which has a dialog that I want to display an animation on. I am doing something similar to the Windows dialog when a copy operation is occuring. However, I have an animation of a PC and a watch communicating. My background color in the AVI file is white (RGB 255, 255, 255). Here is the code I use in my WM_INITDIALOG message:
hAnim = CreateAnimationCtrl(hDlg, IDC_ANIMATE);
Animate_Play(hAnim, 0, -1, -1);
hdc = GetDC(GetDlgItem(hDlg, IDC_ANIMATE));
SetBkColor(hdc, RGB(255, 255, 255));
The IDC_ANIMATE Id is the animation control on the dialog. Here is the code for the CreateAnimationCtrl function:
HWND CreateAnimationCtrl(HWND hwndDlg, int nIDCtl)
{
HWND hwndAnim = NULL;
RECT rc;
POINT pt;
hwndAnim = Animate_Create(hwndDlg, IDC_ANIMATE, ACS_TRANSPARENT | WS_CHILD, ghInst);
GetWindowRect(GetDlgItem(hwndDlg, nIDCtl), &rc);
pt.x = rc.left;
pt.y = rc.top;
ScreenToClient(hwndDlg, &pt);
SetWindowPos(hwndAnim, 0, pt.x+10, pt.y,
149, 25,
SWP_NOZORDER | SWP_DRAWFRAME);
Animate_Open(hwndAnim, MAKEINTRESOURCE(IDR_AVI));
ShowWindow(hwndAnim, SW_SHOW);
return hwndAnim;
}
In addition to the window style in the creation, I also have it set for the resource.
It seems like I've covered everything, however, the AVI clip plays showing the white background on my gray dialog.
Anyone have any suggestions?
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
I think the problem is just in your AVI file. Did you set the transparency color in your AVI editor? I have only used the Animation Control once and all I had to do was import my AVI resource and call the Open method on the Animation control.
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Also, my background color is RGB(255, 0, 255). I found that most AVI files I found on the Internet use this color as the background.
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Tom,
I was able to get the transparency to work, however it only seems to work on video cards with 32-bit color depth. When I go down to 16-bit color depth, the magenta background that I have shows up. I am handling the WM_CTLCOLORSTATIC message in my message procedure to set the background color of the image to the dialog color as shown below.
case WM_CTLCOLORSTATIC:
hdc = (HDC)wParam;
dwColor = GetSysColor(COLOR_BTNFACE);
SetBkColor(hdc, dwColor);
return TRUE;
Do you have any suggestions on how to get this to work with all video card bit depths?
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
Are you testing in XP? I've had a similar problem some months ago, everything worked just fine in every OS except XP. Finally, modifying the style right before opening the file seems to fix the problem:
DWORD dwStyle = GetWindowLong(hwndAdmin,GWL_STYLE);
dwStyle = dwStyle | dwAdd;
SetWindowLong(hwndAdmin,GWL_STYLE,ACS_TRANSPARENT);
Animate_Open(hwndAnim, MAKEINTRESOURCE(IDR_AVI));
...
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I am sure there was a switch for Visual Studio 6.0 that displayed build times. Dammned if I can remember it though.
Can anyone 'jog' my memory.
Ryan.
Computers allow you to make more mistakes than any other invention, with the possible exception of handguns and tequila.
|
|
|
|
|
Start msdev.exe with the /y3 command. Build times should be displayed now...
-----------------------
New and improved: kwakkelflap.com
My first CP article: Pseudoregisters[^]
"When I hear of Schrödinger's cat, I reach for my gun." - Stephen Hawking
|
|
|
|
|