|
I know converting Win32-app to ActiveX looks like a good idea. I'm here to explore other options.
Umer Mansoor
|
|
|
|
|
For your 'ShellExecute()' will work. If you don't wanna to display the process(on desktop/taskbar), just put last parameter of the fuction as 'SW_HIDE'(0).
Well ! Try it...
-Malli...!
|
|
|
|
|
didn't work!!! i want to show it, not hide it, but INSIDE my APP
Umer Mansoor
|
|
|
|
|
which key work to google for dll work principle? give me some key work I can get idea.
|
|
|
|
|
|
It's clear how to set right and left margins in an instance of CEditView. Is there a way to effectively set a top margin?
--hsm
|
|
|
|
|
In the PARAFORMAT2 Structure there is a member called dySpaceBefore. You will need to build a function to call this member using the dwMask member. The value must always be > than or = 0. The Size of the spacing is in twips. You may be able to set up something similar in the PARAFORMAT structure if you are using later versions of Visual C++. Go to MDN.COM and do a search for PARAFORMAT OR PARAFORMAT2. I think there is an example there somewhere..??
regards,
RRL
|
|
|
|
|
sorry. I ment msdn.com not mdn.com also, if you ar running v.s. 6.0 PARAFORMAT may be the structure to use...
RRL
|
|
|
|
|
Much thanks, I'll take a look.
--hsm
|
|
|
|
|
I just looked. Two problems occur to me; first, this is for a CRichEditView, not a CEditView. The other problem is that this would allow control of the space above a paragraph--- not the space above the page. Perhaps I'm missing something?
--hsm
|
|
|
|
|
For those with the same problem, a tentative answer is to set the rectangle in the CEdit control:
void CPGNTextView::SetTopMargin()<br />
{<br />
CEdit &theEdit = GetEditCtrl();<br />
CRect r;<br />
theEdit.GetRect(&r);<br />
TRACE("t=%d l=%d b=%d r=%d\n",r.top,r.left,r.bottom,r.right);<br />
r.top = TOP_MARGIN;<br />
theEdit.SetRect(&r);<br />
TRACE("t=%d l=%d b=%d r=%d\n",r.top,r.left,r.bottom,r.right);<br />
}
And then to do it again in WM_SIZE and WM_SETFONT handlers. Seems like overkill, but the CEdit control loses this information every chance it gets so you just have to help it along so to speak.
--hsm
|
|
|
|
|
Is there a way I can do something like this:
<br />
class MyClass<br />
{<br />
...<br />
private:<br />
class MyInnerClass: public CWnd<br />
{<br />
...<br />
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);<br />
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);<br />
...<br />
};<br />
...<br />
};<br />
??
I've been trying for a while, and the code doesn't even compile (if I declare the class outside the first one, everything works OK, but I want the class to be inner). I suspect it's a matter of names for the message maps, but can't figure out the right one...
Thanks!
Alberto.
|
|
|
|
|
Why do you feel the inner class is necessary?
I would probably have done this instead:
class MyInnerClass: public CWnd<br />
{<br />
...<br />
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);<br />
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);<br />
...<br />
};<br />
<br />
class MyClass<br />
{<br />
...<br />
private:<br />
MyInnerClass* m_InnerClass;<br />
...<br />
};
And avoid the entire problem.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
It's what I've done, but I feel the inner class is necessary for preventing unnecesary access to it.
I just wanted it to be sort of "private", and it seemed to me it was the best way (ok, i admit it...I'm a java programmer).
Thanks for the answer (sorry for my english)...
Alberto
|
|
|
|
|
If you really want to hide the internals of your class, then
make a forward declaration like this:
class MyInnerClass;
then use it privately in some other class:
class SomeOtherClass
{
...
private:
MyInnerClass* m_MyInnerClass;
...
};
and then declare the MyInnerClass in the source file along with its implementation as the same source file as SomeOtherClass and only SomeOtherClass will ever be able to actually 'use' the MyInnerClass.
Or, just declaring the pointer to it like the original example, that pretty much prevents ANYTHING else from using the MyInnerClass anyhow.
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
|
I've tried it, and didn't work (maybe I missed something elsewhere).
Thanks.
|
|
|
|
|
|
johni__boy wrote: Can anybody help me please to find out the bugs in the folowing code . The code doesnt contain any syntax errors but still it doesnt run .
It would be more appropriate if you found the problematic code (i.e., bug), and then ask us what is wrong with it. Asking us to search through a bunch of code to find out what is wrong is not what we (most of us at least) are here for. Narrow your code down to just a few statements and you'll get way more help.
For starters, calling findnumber() with NULL as the second argument will result in a problem when you go to dereference the pointer. The code you have to add a new number to the list is wrong.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
thanks for your comments, probably you are right.
The second argument by calling findnumber() is not Null but it is used to access to the structure :
typedef struct entry
{
int number; // our entry
int freq; // how often we've seen it
struct entry *next; // pointer to the next item
} entry_t;
I don't understand how is the second line of the input text is loaded in the buffer and what number we are adding to the list.
|
|
|
|
|
johni__boy wrote: The second argument by calling findnumber() is not Null but it is used to access to the structure :
Initially you set entrylist = NULL; so the first time you call the findnumber function the second argument is NULL. So in the findnumber function you should first check to see if the second argument named "list" is NULL, and if it is, you should return NULL.
Now, look at the last two lines of this block and imagine adding the first node into an empty list.
else
{
// no, create new one.
entry = (entry_t*)malloc(sizeof(entry_t));
entry->freq = 1;
entry->number = number;
entry->next = entrylist;
entrylist = entry->next;
}
1. again, initially entrylist is NULL
2. you create a memory block to hold a node and the next pointer is pointing to entrylist which is NULL. ok
3. entrylist should point to entry not entry->next.
I don't know if there are other problems, but that's what I see without compiling the code. You should learn to use breakpoint, the stack trace, and the watch window because these problems can be easily spotted.
|
|
|
|
|
looks like homework to me....
onwards and upwards...
|
|
|
|
|
Why make a linked list manually? Use a std::list and your bugs disappear and the program shrinks down to a handful of lines. Unless of course it's a learning exercise or even (gasp) homework.
Steve
|
|
|
|
|
I need to register IITAPIEventNotification interface in order to proces events. For that I need a callnot.h and callnot.cpp files, but I don't have them. How can I get them?
|
|
|
|
|
Greetings:
I am trying to experiment with making an application with flexible windows that show different things and can be opened and closed at will and in no particular order. I do not want to involve the document / view architecture. There's no need for an underlying document; my program receives input data from external ports of various kinds.
For openers, I tried to create an SDI application with no Doc/View but whose client is a CFormView, not a CChildView. Why is this hard?
Should I REPLACE the CChildView client window with a CFormView? Or, should I create a CFormView and then derive the CChildView from the new CFormView (instead of from CWnd as the App Lizard would have it)?
I have a metric tonne of books on the subject of programming in MFC and I have yet to encounter one, just ONE, that clearly explains and lays out the architecture of SDI, MDI, Doc/View, non-Doc/View, splitters, CMainFrame, Views, etc, etc. I would like to understand these things in such a way that I can finally feel that I have some measure of control and choice as to how my application windows behave and can write a program that breaks from the straight jacket that is the MFC App-Lizard. Has anyone out there encountered a book or resource that does this? I mean, explain it to me like I'm 4 years old! Insult my intelligence! Just make it clear!
There, I feel better. Thanks in advance to anyone who responds.
Cheers,
Mark
|
|
|
|