|
Okay. I finally fixed the problem with help from Dean Harding of GameDev.
One more questions.
Here is one working DLL declaration.
-----
#if defined(FIRSTDLL_DLL)
# define FIRSTDLL extern "C" __declspec(dllexport)
#else
# define FIRSTDLL extern "C" __declspec(dllimport)
#endif
-----
I am able to compiler the DLL using this code too.
-----
// FirstDLL.h
#ifndef FIRSTDLL_H
#define FIRSTDLL_H
#define IMPORT __declspec(dllimport)
#define EXPORT __declspec(dllexport)
#ifdef __cplusplus
extern "C"
{
#endif
class EXPORT myClass
{
...
};
#ifdef __cplusplus
}
#endif
#endif
-----
Is there an advantage one declaration has over the other?
Thanks,
Kuphryn
|
|
|
|
|
Hello,
I have a dialog bar that contains the following SliderCtrl message handler:
OnCustomdrawSliderProg(NMHDR* pNMHDR, LRESULT* pResult)
Inside this handler, I call another function to update a 2nd dialog bar's windows. However, when this occurs, the slider control is randomly (time) redrawn on the 2nd dialogbar's client area at random places. I assume I'm mixing device contexts somehow.
Functionally I want my 2nd dialog bar to have a 'live' response to a user adjusting the CSliderCtrl on the 1st dialog bar. Has anyone a solution for a clean way to do this? I've tried to handle the lose-focus SliderCtrl message (works without odd slider drawing), but then if the user uses the arrow keys, the 2nd dialog bar is not updated.
Thanks!
JennyP
|
|
|
|
|
JennyP wrote:
Functionally I want my 2nd dialog bar to have a 'live' response to a user adjusting the CSliderCtrl on the 1st dialog bar
Handle WM_HSCROLL - this message is sent whenever thumb is moved using mouse/keyboard. When user releases the mouse, you'll get WM_HSCROLL with TB_ENDTRACK code. You'll also get TB_ENDTRACK after each keypress changing thumb position.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
Hi Anyone and Everyone,
I would like to know how to develop a Code Completion control (similar to that in Visual Studio - Intellisense) and such available in almost all popular code editors. I am not able to find such info. anywhere. If you can't help directly, plz direct me to some place where i may find some resources to help me atleast !
I do hope I get a quick reply
Deepak
|
|
|
|
|
Hi,
I've a function in CMainFrame class which shows a progress bar in the status bar.
<br />
void CMainFrame::showProgress()<br />
{<br />
<br />
RECT MyRect;<br />
m_wndStatusBar.GetItemRect(1, &MyRect); <br />
m_ctrlProgress.Create(WS_VISIBLE|WS_CHILD, MyRect, <br />
&m_wndStatusBar, 1); <br />
<br />
m_ctrlProgress.SetRange(0,100); <br />
m_ctrlProgress.SetStep(1);
<br />
<br />
for (int I = 0; I < 100; I++)<br />
{<br />
Sleep(10);<br />
m_ctrlProgress.StepIt();<br />
}<br />
}<br />
Now, I wish to access this progress bar from my CView class.
This application uses sockets and whenever I receive a new message I wish to show the some activity in the progress bar.
|
|
|
|
|
AfxGetMainWnd() returns the main window, you just need to cast it to be a CMainFrame.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
(Newbie-Warning!)
Hi,
Is there anyone that got a short sample code on how to edit/modify the contents of an external binary file at an exact position?
I've read some articles on how to modify ASCII files, but when it comes to binary files and modifying data in an exact offset location (like a hexeditor)... I'm stuck...
Regards,
Johan
|
|
|
|
|
fopen(filename, "wb");
fseek(pos, offset);
fwrite(data, size, count, filePointer);
fclose(filePointer);
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
Thanks for your quick help!
I'm now heading for my keyboard to try it out!!
/Johan
|
|
|
|
|
If I have a class A, I can also create a class within it called B. Is there any practical use for this? To illustrate my question I will give an example.
<br />
class A<br />
{<br />
int m_nMemberOfA;<br />
<br />
class B<br />
{<br />
public:<br />
void MethodOfB();<br />
};<br />
};<br />
<br />
...<br />
<br />
void A::B::MethodOfB()<br />
{<br />
...<br />
}<br />
Can B gain access to the member variables of A or anything like that without having to pass the "this" pointer?
Thanks in advance,
Clint
|
|
|
|
|
clintsinger wrote:
Can B gain access to the member variables of A or anything like that without having to pass the "this" pointer?
No, of course not. What would happen if they both had an int called a ?
You'd encapsulate one class within another if it existed solely as a helper for that class, if only class A had a need to create instances of class B. Then you could make it private or protected in class A, and control the fact that only class A could make them.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I think your question is, are nested classes in C++ like inner classes in Java? The answer is no. Offhand, I'd say they are much like static nested classes in Java.
The purpose of nested classes is to express scoping of names.
|
|
|
|
|
Does anyone know how to write data to cd-r drives using IoControl codes in the platform sdk??
|
|
|
|
|
The fact that several expensive SDK's exist to do this suggests to me that it is not an easy task.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Check out the Image Mastering API (IMAPI)
available now under WinXP.
|
|
|
|
|
Was going to use that but it only works on XP not 2000/me/98 etc..
Thanks
|
|
|
|
|
Why have you asked this question three times ?
I'm fairly sure there is an example on the site. The app wizard also creates an app with one splitter, it should not be hard to increase the count to support four views, I would think.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
I also try to find this on the site, but I can't got it. Could you mind tell me where can i find it?
|
|
|
|
|
I dunno, I thought I'd seen it. Maybe it was in MSDN.
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
hello Everybody,
I am working on a project involving PCs as peer sensors on a network. The sensor can use ccd cameras (microscops), can process acquired images, can replicate data on an overlay network (P2P), can distribute processing (actually start, control and stop them remotely).
I'd like to create a object-oriented, component-oriented "generic" framework in C++... for sensors in general and for my application in particular. Also, I'd like to have some functionalities (Input, Processing, Networking...), as independent components, i.e. that can be used without the others (separate DLLs?).
Sensor Component
|
|- Input Component
|
|- Processing Component
|
|- Networking Component
|
|- Coordinator Component
MySensor Component : inherited from Sensor Component
|
|- Vision Component : inherited from Input Component
|
|- MyProcessing : inherited from Processing Component
|
|- P2P : inherited from Networking Component
|
|- MyCoordinator : inherited from Coordinator Component
How do I make such a framework? What tools are the easiest?
Where should I start?
Should I buy a book "creating our own framework for dummies"?
Any comments are welcome!!
Thanks a lot!
Bertrand Boichon
Research Assistant
Electrical & Computer Engr.
Oregon State University
|
|
|
|
|
Anonymous wrote:
I'd like to create a object-oriented, component-oriented "generic" framework in C++...
Your description suggests a class library, not the framework. What exactly do you mean by 'generic'? 'Generic' as in 'generic programming'?
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
I want to ask how to display four view at the same time(i.e. splitting), each views are come from different class?? (e.g view1, view2 view 3, view4)
|
|
|
|
|
You want to display in 2x2 or 4x1 or 1x4??
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
i WANT TO DISPLAY 2X2
THX!!!
|
|
|
|
|
Then you can try this
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT ,<br />
CCreateContext* pContext)<br />
{<br />
if (m_wndSplitter.CreateStatic(this, 2, 2) == FALSE)<br />
return FALSE;<br />
<br />
if (m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CView1), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CView2), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CView3), CSize(100, 100), pContext) == FALSE ||<br />
m_wndSplitter.CreateView(1, 1, RUNTIME_CLASS(CView4), CSize(100, 100), pContext) == FALSE)<br />
return FALSE;<br />
<br />
return TRUE;<br />
}
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|