|
My response for Question 1
The Mediator design pattern gets used to coordinate communication between many colleagues. This would apply to your situation if that communication needed to exist. The Publisher-Subscriber pattern exists for one-way communication, from the Publisher to the Subscriber. From your description of the application, I agree that you have used the correct design pattern for the situation. However, you may need to reconsider your implementation since so much depends on your Publisher interface.
My response for Question 2
Your Publisher-Subscriber framework should handle this. Instead of publishing to a local object (in the same process), it uses some sort of IPC. How this gets done depends on your implementation. However, if you've defined your Publisher-Subscriber interfaces correctly, you should have the ability to replace the classes that implement intraprocess communication with interprocess communication. Many RPC frameworks exist; for a starting point, check out Wikipedia[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi,
I am running into some problems with this ActiveX function, I use the Class View to generate the method, it is all done through Visual C++ Wizards. Everything compiles, so say I create a method through the wizard as follows:
void CTestCtrl::Testing(VARIANT* test)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
}
So I have not entered anything into the code.
Now I'm trying to access this function in Visual Basic .NET so I do the following
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim test123 As Object
AxTest.Testing(test123)
End Sub
When I run the VB program it crashes.
Any help would be greatly appreciated.
|
|
|
|
|
Have you got any info on the crash? A stack trace and the exception generated would be a bug help.
Steve
|
|
|
|
|
This is the error I'm getting
An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll
Additional information: Object reference not set to an instance of an object.
|
|
|
|
|
Can I have a look at the .ODL for the method in question (I want to see that attributes are in place).
Steve
|
|
|
|
|
My VB lets me down here but I suspect nothing is wrong. The Dim statement defaults to "Nothing" so all is probably working as it is meant to. I suspect is you changed to "As Object" to "As Integer" all would work well.
Steve
|
|
|
|
|
Here is the part of the ODL file, this is in the method part
[id(9), helpstring("method Testing")] void Testing(VARIANT* test);
I also tried putting the Integer value there, but the same problem.
|
|
|
|
|
I notice there are no attributes on "test". Given that you're using a pointer to a variant I would expect this to look like the following:
[id(9), helpstring("method Testing")] void Testing([in, out]VARIANT* test);
Steve
|
|
|
|
|
Thanks that fixed the problem. Thanks for everyones help.
|
|
|
|
|
Hello everyone!
I've been wanting to know how good/bad I'm doing as a programmer... Can any expert help me out? (You know, how I'm doing with coding conventions, comments, resource usage, etc.) Here's one of my latest programs: (I've asked a LOT of questions for this one :P )
Binary: www.sulfurmidis.com/mazzee-proto7-NORELEASE.zip (Open "MazzeeMaps.lmg" when it asks you for a map)
Source: www.sulfurmidis.com/Mazzee-source.zip
Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
There is always room for improvement. If you are interested to improve your code, you may look into:
Scott Meyers, "Effective C++", "More Effective C++", different editions.
Steve McConnell, "Code Complete", 2nd edition.
Bjarne Stroustrup, "The C++ Programming Language", 3rd edition.
Nick Kisialiou
|
|
|
|
|
RainbowWyrm wrote: Scott Meyers, "Effective C++", "More Effective C++", different editions
A real cool and effective book.
Hi 5 scott.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
very little hungarian notations used, somehow i like using it .
though c++ allows declaration of variables inbetween statements, i would prefer all variables declaration at start of the block.
some good practice like if(x==NULL) can be coded as if(NULL == x).
Some comments were not required. like //Set it.
These are few that i can comment on.
-Prakash
|
|
|
|
|
1) Remove all the global variables.
2) quite a lot of code replication. Refactor or Redesign.
3) Create a Dispatcher routine for class and do the forwarding for
keyboard events to appropriate routines each of them handling one type of event.
look back,think of extensibility also. What does it take for another person to easily add code
to your project? Iterate, rethink, look for better concepts,apply generic algorithms. use c++
standard library where you can.
Vipin - MVP
|
|
|
|
|
you were vipinasda right?
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
|
you could have changed your screen name right? why you created a new account? that means your message
count'd start again from 0.
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
hehe, no probs. I had an invalid email id associated with that screen name.
Vipin - MVP
|
|
|
|
|
VivekuniQ wrote: you were vipinasda right?
I believe you right!.. a suggestion if you don't mind please don''t make this forum lounge.. please..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
do you think i should take him to lounge to say this? or you felt something about the dialogs i had with toxcct? anyway i'd try talking less in general.
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
VivekuniQ wrote: do you think i should take him to lounge to say this?
sorry for hurting you!.... no probs people like you here !
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
RainbowWyrm:
Thanks! I'll look them up on Sears next time I go!
some good practice like if(x==NULL) can be coded as if(NULL == x).
You mean that the second way is better? Why?
quite a lot of code replication. Refactor or Redesign.
You mean the movement functions? You know of a shorter way? TELL ME! I've been looking for that for ages!
Create a Dispatcher routine for class and do the forwarding for<br />
keyboard events to appropriate routines each of them handling one type of event.
For the game and map maker? Oops... I didn't know you could do events in non-dialog apps... How?
_T_H_A_N_K_S_ you all!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Hello everyone!
I just want to know how to do OpenGL with MinGW/GCC... I don't want to use VC++ for this, because I want to be portable... But how do I open a window in std C++, and how to I get rid of these errors?:
C:\>g++ Lesson1.cpp<br />
Lesson1.cpp:12:60: gl\glaux.h: No such file or directory<br />
<br />
C:\>g++ Lesson1.cpp<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x31):Lesson1.cpp: undefined<br />
reference to `glViewport@16'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x40):Lesson1.cpp: undefined<br />
reference to `glMatrixMode@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x48):Lesson1.cpp: undefined<br />
reference to `glLoadIdentity@0'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x76):Lesson1.cpp: undefined<br />
reference to `gluPerspective@32'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x85):Lesson1.cpp: undefined<br />
reference to `glMatrixMode@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x8d):Lesson1.cpp: undefined<br />
reference to `glLoadIdentity@0'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0xa2):Lesson1.cpp: undefined<br />
reference to `glShadeModel@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0xcd):Lesson1.cpp: undefined<br />
reference to `glClearColor@16'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0xda):Lesson1.cpp: undefined<br />
reference to `glClearDepth@8'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0xe9):Lesson1.cpp: undefined<br />
reference to `glEnable@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0xf8):Lesson1.cpp: undefined<br />
reference to `glDepthFunc@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x10f):Lesson1.cpp: undefine<br />
d reference to `glHint@8'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x12c):Lesson1.cpp: undefine<br />
d reference to `glClear@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x134):Lesson1.cpp: undefine<br />
d reference to `glLoadIdentity@0'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x192):Lesson1.cpp: undefine<br />
d reference to `wglMakeCurrent@8'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x1cd):Lesson1.cpp: undefine<br />
d reference to `wglDeleteContext@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x672):Lesson1.cpp: undefine<br />
d reference to `ChoosePixelFormat@8'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x6d6):Lesson1.cpp: undefine<br />
d reference to `SetPixelFormat@12'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x725):Lesson1.cpp: undefine<br />
d reference to `wglCreateContext@4'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0x787):Lesson1.cpp: undefine<br />
d reference to `wglMakeCurrent@8'<br />
C:\DOCUME~1\DARTH_~1\LOCALS~1\Temp/ccEXbaaa.o(.text+0xabd):Lesson1.cpp: undefine<br />
d reference to `SwapBuffers@4'<br />
collect2: ld returned 1 exit status<br />
<br />
C:\>
Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
There is no such thing as a window in C++. Instead, each platform has it's own windowing library. You can move away from MFC and use Win32, which is a lot more work. You could also try TCM/TK ( I think that's what it's called ) or some other cross platform windowing library.
Have you seen the NeHe site ? He has OpenGL samples in just about every possible configuration, for most platforms.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|