|
Platypus Animator.
Maxwell Chen
Lets make bugs better!
|
|
|
|
|
|
CAnimateCtrl only can display AVI file?
i want to post my animation .gif file on my dialog but don't know how. I only found a big class on codeguru. but i dont' want an another big class add to my application to run a .gif file. another one is CAnimation, that only can run avi file.. ( from what i understood). i want .gif not avi. anyway. i dont' even know how to create .avi file. what kind of software that i have to use to create avi.. adobe photoshop doesn't have .avi file format when you save.
i think i have to drag picture icon from control box( control box that has all check, radio, animation, treectrl,listctrl,.. etc.) and then just post my .gif on the dialog like other check boxes and radio buttons.
how can i do that? no. can i do it?
|
|
|
|
|
'cause you have to pay money to develop software that deals with .gif files. Search CP; i know there's at least one article on playing .gif files. Or search the Net; there are quite a few AVI creation proggies out there, some free even.
[update]
Just stumbled across this AVI software; give it a look
---Shog9---
Extreme ways are back again, extreme places i didn't know
I broke everything new again, everything that i'd owned -- Moby, Extreme ways
|
|
|
|
|
it's not that difficult all you have is to add an ActiveX control to your dialog called Animation GIF Control .. easy to use .. enjoy it )
MCP
|
|
|
|
|
how? could you tell me please, i have never used activex control. i read activex control from mfc book by Mike Blaszczack. i though activex control is a server type and it is like DLL. that's what i understood from what i read.
now u are saying that i can call animation GIF control. so i looked for it and i could not find animation GIF control when you inserting activex control to your dialog.
i only found
1) animation control 6.0
2) animation control version 5.0
3) direction animation control
4) direction animation path
5) direction animation sequencer
6) direction animation structure
7) direction animation window
so i added each one of them to my applicaiton, but i dont' know how to use them , i couldn't find in MFC lib either.. i search for those classes that activx control created or vc 6 created in MFC and online.. but can't find it.
tell me how to use activex controla and where can i find animation gif control?
i just simple want my gif file running on my dialog.
i didn't except posting gif file on dialog is that difficult..
|
|
|
|
|
why dont u just render each frame to screen? gif are small enuf.
norm
|
|
|
|
|
hi.. all
my application is a printing program.
the program gets all the files from the choosen folder and insert to the tree, ( tree ctrl)
there are checkbox for each tree item.
when the item is checked, do printing, and estimate how many pages those checked files will be printed.
to do estimating and printing, at least one file or one item has to be checked, otherwise, the message "no file is checked". will shows up.
that's basiscally what my program does.
if the program (i just double click on .exe file from debug folder) is run under win2000, and i check on one file, then click on estimate pages button to estimate num of pages that will be print. it gives me num of pages.
but under XP, i did the check the same file, then click on estimate pages button, "no file is checked " message shows up.
why under win2000 works and not under xp eventhough runing the same program, did the same thing, calling the same function?
oh.. i dont' have visual studio under xp though... but i have .dll pasted into my program folder.. so it is runnable under xp too.
|
|
|
|
|
In VC6, WSAGetLastError() returns the proper error code, but in VC7 it doesn't. It returns a system code contrary to the documentation. Anyone know why?
Code-------------------------
#include <iostream>
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#pragma comment (lib, "ws2_32.lib")
using namespace std;
int main(int argc, char *argv[])
{
if (!gethostbyname("www.microsoft.com"))
{
cerr << "gethostbyname error " << WSAGetLastError() << endl;
}
return 1;
}
--- Output from VC6 ---------------------
gethostbyname error 10093
--- Output from VC7 ---------------------
gethostbyname error 5
Another oddity is that VC6 returns almost instantly where vc7 takes several seconds (1.4Ghz machine)
|
|
|
|
|
You apparently haven't even bothered to look up what error 5 is (if you had you wouldn't ask).
|
|
|
|
|
Please read my post before attempting to respond.
If you look in the documentation, gethostbyname() returns "a specific error number can be retrieved by calling WSAGetLastError" it continues on to list several error codes. One of which is WSANOTINITALISED, the correct error code in this case.
WSAGetLastError() does not return the specific error code (consistant with previous versions of VC) but a more generic system error of 5. The question is not what does the returned error message mean but why WSAGetLastError() returns "access denied" and not WSANOTINITALISED?
Does anyone with some experience know?
|
|
|
|
|
I have a function which is being passed a _TCHAR*. I need to find out how long the string is, but when I call sizeof( the_tchar ), it always returns 4, no matter what the string, which of course tells me that it is returning the size of the pointer, not the string. How do I get the length of the string being pointed to by the _TCHAR*?
|
|
|
|
|
|
if the return type of a function is defined as const CStringArray & and you define a local variable of that type, can you then call RemoveAll on the CStringArray to delete all entries? if not, would this cause a memory leak?
i.e.
const CStringArray & aszarray = foo(a,b)
aszarray.removall(). ????
|
|
|
|
|
|
How can I get this to compile? I am trying to get late binding to set the size of the char to the length of the document that I specify. But I keep getting the following errors, even when I declare the function virtual in the class definition. Here is the code sample:
void CMyClass::MyFunction(){
CFile myFile;
UINT uBytesRead;
CSting szText;
myFile.Open("File.txt",CFile::modeRead,NULL);
int nFileSize = myFile.GetLength();
char Buff[nFileSize];
while(uBytesRead = myFile.Read(Buff,nFileSize){
Buff[uBytesRead] = NULL;
szText += CString(Buff);
}
MessageBox(szText,"Thank you for your help",MB_OK);
}
My class definition:
class CMyClass : public CDialog
{
virtual void MyFunction();
}
Here are the errors I got when I tried to compile the program:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
If all you Herb Sutters and Tim Smiths can help me, I will be very greatful and wish you a long and healthy life. If you can read my code and suggest and alternate way of doing what I want it would be cool too.
|
|
|
|
|
you have to allocate this dynamically
char * Buff = new char[nFileSize];
....
delete [] Buff;
-c
Cheap oil. It's worth it!
|
|
|
|
|
So would this be the correct way to do it?:
void CMyClass::MyFunction(){
CFile myFile;
UINT uBytesRead;
CSting szText;
myFile.Open("File.txt",CFile::modeRead,NULL);
int nFileSize = myFile.GetLength();
char* Buff = new char[nFileSize];
while(uBytesRead = myFile.Read(*Buff,nFileSize){
*Buff[uBytesRead] = NULL;
szText += CString(Buff);
}
MessageBox(szText,"Thank you for your help",MB_OK);
}
|
|
|
|
|
actually, you need to add 1 to the length of the buffer, if you want to put the NULL on the end:
char* Buff = new char[nFileSize + 1];
then, before the MessageBox, you have to "delete [] Buff".
-c
Cheap oil. It's worth it!
|
|
|
|
|
Thank you for your help, it really helped me alot and got me to the solution.
void CMyClass::MyFunction(){
CFile myFile;
UINT uBytesRead;
CSting szText;
myFile.Open("File.txt",CFile::modeRead,NULL);
int nFileSize = myFile.GetLength();
char* pBuff = new char[nFileSize];
while(uBytesRead = myFile.Read((void*)pBuff,nFileSize){
Buff[uBytesRead] = NULL;
szText += CString(pBuff);
}
delete [] pBuff
MessageBox(szText,"Thank you for your help",MB_OK);
}
|
|
|
|
|
Hi,
I would like to know how I could go about writing a program that can record mouse clicks on a Excel Spreadsheet and sending the XY coordinates to a file?
Any ideas on how to begin?
Thanks, James Wong
|
|
|
|
|
You could use SetWindowsHookEx() to install a system wide WH_GETMESSAGE hook (inside a DLL), get the HWND of the window you want to track, filter out mouse message going to the window, and then send a custom message to your application to write this data to a file.
Check out this article:
http://www.codeproject.com/dll/hooks.asp
Good luck!
--
Dana Holt
Xenos Software
|
|
|
|
|
Hi:
There are two things that I am trying to achieve:
1) the default behaviour of the CListCtrl is that the user clicks the item he/she desires to edit once (to give it focus). Waits a little bit, and then clicks it again to start editing it. It the user simply double clicks on the unfocused item, it doesn't work. Any ideas how I can override this behaviour?
2) I have written the code that allows the user to right click the item. A menu pops up. The user selects "Insert ...". the code add a line above the focused line and gives focus to the new line. Until this point, it works beutifully. Then I would like the code to enter into the editing mode for the item (i.e., set the blinking cursor inside of the item - ready for keyboard input) without the user having to click the newly created item again. Here I have a problem. here is what I have got so far:
CDocUniverse* pDoc = (CDocUniverse*) GetDocument();
int nItem = pDoc->m_ViewUniverseListBox.GetNextItem(-1, LVNI_FOCUSED);
if (nItem == -1)
nItem = 0;
pDoc->m_ViewUniverseListBox.InsertItem(nItem, "", 0);
UINT uFlags = LVIS_SELECTED | LVIS_FOCUSED;
pDoc->m_ViewUniverseListBox.SetItemState(nItem + 1, 0, LVIS_SELECTED);
pDoc->m_ViewUniverseListBox.SetItemState(nItem, uFlags, uFlags);
// Send notification
CString str = pDoc->m_ViewUniverseListBox.GetItemText(nItem, 0);
LV_DISPINFO dispinfo;
dispinfo.hdr.hwndFrom = pDoc->m_ViewUniverseListBox.m_hWnd;
dispinfo.hdr.idFrom = pDoc->m_ViewUniverseListBox.GetDlgCtrlID();
dispinfo.hdr.code = LVN_BEGINLABELEDIT;
dispinfo.item.mask = LVIF_TEXT;
dispinfo.item.iItem = 0;
dispinfo.item.iSubItem = 0;
dispinfo.item.pszText = (LPTSTR)((LPCTSTR)str);
dispinfo.item.cchTextMax = str.GetLength();
GetParent()->SendMessage( WM_NOTIFY, pDoc->m_ViewUniverseListBox.GetDlgCtrlID(),
(LPARAM)&dispinfo );
Any ideas?
Thank you
|
|
|
|
|
Anton A. Loukine wrote:
Hi:
There are two things that I am trying to achieve:
1) the default behaviour of the CListCtrl is that the user clicks the item he/she desires to edit once (to give it focus). Waits a little bit, and then clicks it again to start editing it. It the user simply double clicks on the unfocused item, it doesn't work. Any ideas how I can override this behaviour?
Hi,
I think that you mean this:
void CMyDlg::OnLbnDblclkList()
{
int nCurSel = m_listBox.GetCurSel();
CString szCurSel;
m_listBox.GetText(nCurSel, szCurSel);
AfxMessageBox(szCurSel);
}
When a user doubleclicks an item in the list, a message box displays the selection.
After you should change the AfxMessageBox that is only for dimostrative purposes to something that fits your needs.
I hope this helps.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
I want to change the background colour of a button but am unable to do it. This button is attached to a class derived from CButton, and i want the code to reside in this class, not the dialogs class.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|