|
sorry about the link... get it at www.upx.sourceforge.net
|
|
|
|
|
|
Shrinking the size of an MFC app in VC++ 7.x is difficult. In VC++ 6.0, you could get it down to about 160k but not much more than that.
Since it's dialog based, I'd consider just converting it to a standard windows app and taking the parts of afxinet.h that you need.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
If you want to keep it small then I think you should avoid using MFC.... write a simple application without them...
Did you compiled your app using the static MFC library version? You cannot hope that who will use your installed has already the MFC Dlls
|
|
|
|
|
Did you look at this?[^]
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
I've looked all over this site, and googled it but I can't seem to get the count function to work. here's what I have:
int iCount = count(vecWords.begin(),vecWords.end(),sWord)
where sWord is a struct variable of the type the vector is holding. I even try to hard-code a 1 or any other type of variable in there and I keep getting the same error message:
error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::allocator<_Ty>::value_type' (or there is no acceptable conversion)
Can anyone help? Thanks!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Have you defined the == operator for the type used as your vector element?
|
|
|
|
|
NO, I haven't. thanks!! but can I define an '==' for a struct?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
bdiamond wrote:
but can I define an '==' for a struct?
Sure:
struct foo
{
int x;
bool operator== ( const foo& rhs ) const
{
return x == rhs.x;
}
};
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
thanks; I knew how to make the overloaded operator, I'm just not that familiar with structs.;)
If it's broken, I probably did it
bdiamond
|
|
|
|
|
in C++, struct s are only classes whose default attribute is public .
of course you can, and better, you must ! (in your case, if you want to use this function)
TOXCCT >>> GEII power
|
|
|
|
|
thanks!!
If it's broken, I probably did it
bdiamond
|
|
|
|
|
hi,
I'm trying to write my own mp3 player using DShow, since this point I've been able to let mp3 start,pause,stop and get duration of song, but I don't know where to start from for showing how times goes forward, need I to use threads or DirectShow provides a simple callback function?
thanks a lot
Paolo
|
|
|
|
|
When you start a playback, first check the length of the song. Then calculate time in a seperate thread timer that runs on a second's interval. This allows you to track the position in the song. The idea is just that you start the timer at the same time when you begin playing.
If you have the DirectX SDK fully installed on your machine, you also get the documentations. Open up the DirectX C++ documentation, and look in the Contents. Go to DirectShow -> DirectShow Tutorials -> Implementing a Seek Bar. There's a concrete example on how to create a seek bar. If you don't have the docs, you can see this topic in the MSDN by following this link.
Happy reading.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I've got DirectX SDK Documentation, now I'll take a look, thanks a lot
Paolo
|
|
|
|
|
I'm writing a MFC MDI application, that has a dockable DialogBar containing a TreeCtrl to manage the application's project workspace. The problem is, I can't seem to initialize or otherwise interact with my tree control. I'm using VS 6.0 professional, I've designed the dialog in the resource editor and given it the id IDD_TREE_ORGANIZER. In addition I assigned the tree control a variable within the dialog class (m_tree). At first I tried to initialize the tree control in the dialog's OnCreate() function, but I just got a blank control. Then I read that the control should be initialized in a dialog's OnInitDialog function. I tried that as well, but again got a blank tree control (though the sample exersize I worked on did fine.. It was on a standard dialog though, and not a dockable dialog bar owned by the mainframe). Does anyone know of some sample code out there that shows how to create and interact with a tree control in a dockable dialog bar in an MFC MDI application that I can use for reference? I've been working on this for weeks and I'm pretty frustrated at this point
|
|
|
|
|
Consider OnInitUpdate().
Kuphryn
|
|
|
|
|
Can someone guide me on how to add text to a word document using "Bookmarks" from a word template "file.dot". I started with the visual C++ code below but I get lost trying to follow the Microsoft Word Objects schema, I just don't know how to tie it in like the VB example.
Visual Basic example code ___________________________________________________
Set wrdApp = CreateObject("Word.Application")
wrdApp.Documents.Open("c:\file.dot")
wrApp.ActiveDocumnet.Bookmarks("String One").Range.Text = "Vb sample"
________end of VB example____________________________________________________
Visual C++ __________________
void SystemAlign::CreateDoc(void)
{
CApplication oApp;
CBookmarks oBooks;
Cbookmark oBook;
CDocuments oDocs;
Cdocument oDoc;
CRange oRange;
COleVariant vtOptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR),
vtTrue((short)TRUE),
vtFalse((short)FALSE);
// Create an instance of Word
if (!oApp.CreateDispatch("Word.Application"))
{
AfxMessageBox("Word failed to start!");
return;
}
oDocs = oApp.get_Documents();
oDoc = oDocs.Open("c:\My Documents\file.dot", vtOptional);
oBooks = oApp.get_ActiveDocument();
//oApp.get_ActiveDocument()
}
|
|
|
|
|
I am writing dll programs to do some file conversions for scientific data. Is there any way for me to do a dyn. memory allocation with out having constants in between the brackets but rather have declared variables.
Here is what I have now..
const int X = 100;
const int Y = 50;
long (*data)[Y];
int x,y;
if (!(pix_data = new long[X][Y])) { printf("Error allocating memory...\n"); return 1; }
I cant figure out a way to have an integer in X and Y that is declared internally (in main()) rather than having 100 or 50. When I place integers, error comes up saying " expected constant expression". Thus, I need not specify 100 or 50 but it looks to other varibles to figure that out. I have looked everywhere..
Any help is appreciated.
|
|
|
|
|
aero6dyn wrote:
const int X = 100;
const int Y = 50;
long (*data)[Y];
int x,y;
if (!(pix_data = new long[X][Y])) { printf("Error allocating memory...\n"); return 1; }
change to
const int X = 100;
const int Y = 50;
long (*data)[Y];
int x,y;
if (!(pix_data = new long[X * Y])) { printf("Error allocating memory...\n"); return 1; }
for the memory allocation and it should be fine.
Rob Manderson
I'm working on a version for Visual Lisp++
|
|
|
|
|
Thanks for the help. Rob..
Although, allocating isnt the issue I am having. Sorry, maybe I wasnt clear with my concern.I want to stay away from having to write:
const int X = 100;
const int Y = 50;
I have internal variables in main() that are assigned the values of 100 and 50. Thus, I would like to use them instead of having constants or define statements.. I want something like
int X = row_size;
int Y = column_size;
Ofcourse, that gives me an error saying "expected constant expression" at the line
long (*data)[Y];
This is because I am guessing c++ needs to know the size of the array before it starts compiling instead of looking in main().
I will have different files w/ different row_sizes and column_sizes so I cant have 100 or 50. So no input by the user specifying the # of rows or columns for each file I call is necessary.
Does that make any sense....
|
|
|
|
|
I am working on simple visual recognition program.
I have two bitmaps - background and background plus unknown object.
I can do convolution to filter out the unknown object, but I cannot figure out how to store the result for further processing.
So far I have same size bitmap with "empty" pixels.
Evetually I'll need to determine the shape of the object and I am looking for some kinda of trace algorithm to save this resulting image.
Thanks for your help Vaclav
|
|
|
|
|
I am trying to do this on my own at home, but have a serious need at work for the following DLL. I can do this in VB unfortunately WinRunner can not use VB DLL's since they are COM servers.
I wrote a simple dll that works but the this project is requires a message box.
I need a c++ dll that
a) I can launch a modalless message box with message passed.
b) keep on top
c) place on screen using x,y
d) close
Can anyone help me? I've never written a c++ dialog before.
thanks all
dhermann@ameriquest.net
|
|
|
|
|
I put a dll on
http://www.immenro.de/test/diadll.dll
you can download it there
the method is called
call_it(int x, int y, int cx, int cy, CString text)
|
|
|
|
|
Is there a way I can perform pointer arithmetic on an iterator? I have a function that goes through a long CString object first and stores the positions of the spaces in a vector<int> object. Going through the normal steps of iterating through each, I am able to get single words, and that works fine. However, the user will have to be able to specify how many words they want extracted at a time, which is held in m_nWordCount. right now I have something like this:
for(iter = intVec.begin(); iter != intVec.end(); )
{
nTemp = *iter;
iter++;
int nTemp2 = *iter;
nTemp++;
strWord = strTemp.Mid(nTemp ,nTemp2 - nTemp);
sWord.word = strWord.Trim();
if(sWord.word.GetLength() > 0)
::vecWords.push_back(sWord);
}
the problem line above is in bold (although it works for one word)
what I want to be able to do is this:
int nTemp2 = *(iter + m_nWordCount);
so that if the user specified 2 as the word count it would get whatever the value is at 2 spaces up.
(first position is 0, second is 5, third is 12)
this would allow them to get the string from position 0 to 12)
of course then I would also have to put my iterator incrementation back in the 'for' loop declaration
Thanks In Advance;)
If it's broken, I probably did it
bdiamond
|
|
|
|