|
Thanks for the code, its much appreciated.
See if I wanted to put menu items how would I do that like:
Help
Exit
About
Thank youAndrew McIntyre
|
|
|
|
|
MrMcIntyre wrote: Thanks for the code, its much appreciated.
But did you look at it? All of what you are doing is in the code.
MrMcIntyre wrote: See if I wanted to put menu items how would I do that like:
Help
Exit
About
Create a menu resource. Load it in that message handler function."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
David,
I am missing a { somewhere can you please help me with it. I am am trying to create a Login Window. I keep on getting an error of (struct HWND__ *,unsigned int,unsigned int,long)" (?WndProcedure@@YGJPAUHWND__@@IIJ@Z) referenced in function _WinMain@16.
case WM_CREATE:
{
hInstance = (HINSTANCE) GetWindowLong (hWnd, GWL_HINSTANCE);
hWnd = CreateWindowEx(NULL, L"Login", NULL,
WS_CHILD | WS_VISIBLE | WS_VSCROLL,
0, 0, 500, 80,
hWnd, (HMENU) 1, hInstance, NULL);
} break;
ThanksAndrew McIntyre
modified on Tuesday, March 16, 2010 4:06 PM
|
|
|
|
|
I wrote a Server/Client application based on TCP/IP. Here are several cases I tested:
1. The applicaiton works fine when both the client and server programs are installed inside a company wired network.
2. The applicaiton works fine when the server program is installed in a computer that is VPNed in while the client program is installed in a company wired network.
3. The client program cannot connect to the server program when the client program is installed in a computer is logged in through VPN into a company network.
Can any one provide suggestion on how to solve the problem in case 3?
|
|
|
|
|
Bugslayer1 wrote: 3. The client program cannot connect to the server program when the client program is installed in a computer is logged in through VPN into a company network.
Are you able to establish connection to the server socket using telnet.exe from the client box?-Suhredayan
|
|
|
|
|
Some thoughts:
- Can you clarify what's the difference between case 2 and 3 (who's client/server, what errors exactly)?
- Have you ruled out firewalling problems... tried different TCP listening ports or port forwarding?
- Have you talked with your company's network administrator, perhaps this kind off traffic is prevented on purpose?
- Have you tried with another client/server application in order to test network connection?
/M
|
|
|
|
|
Here are detailed description of the problem:
Case 2:
client program on computer A within company LAN.
server program on computer B VPNed in company LAN using Sprint aircard and Sonic VPN
I can connect from computer A to B
Case 3:
client program on computer B VPNed in company LAN using Sprint aircard and Sonic VPN
server program on computer A within company LAN
I cannot connect from computer B to A
In both cases, I have added the client and the server programs in Firewall exceptions. The PCs are Windows Vista.
I also did some other tests.
1. A program from the followng link:
Multi-threaded Client/Server Socket Class[^]
This application has the same results as mine. Both applications use Winsock2.
2. A program from the following link:
Simple File Transfer Using the Network Development Kit 2.0[^]
This program works. This program use MFC CSocket.
3. I can also connect to other SQL server by ADO from the computer B.
|
|
|
|
|
I see, so the only difference between your cases is the direction of the network connection.
Would you mind trying the P2P software linked below in my signature? It runs both as server and client... so you be able test both directions simultaneously (computer A connecting B, computer B connecting A). In case a connection fails, is there a different error message than "timeout"?
One more thought. If one of the computer has multiple network adapters (run 'ipconfig' in console window), you can try connecting different IP addresses. If the VPN connection does absolutely not work for you, check with your network admin before you try to circumvent possible filters.
/M
Webchat in Europe Now with 26% more Twitter
modified on Thursday, March 18, 2010 5:48 PM
|
|
|
|
|
Good Day Guys,
I would like to find out if there is anybody who has some time to please
show me how i would go around changing the code here:
http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedscalableapp6b.html[^]
To instead of being able to only echo the data back to the client, i would like to know where the best place is to intercept the complete recieved message from the client process it, and generate a custom answer to send back. Varying from a short reply to the max buffer length 4096 or so.
Please any help will be greatly appreciated
Thanks for your time
Louis
|
|
|
|
|
I don't think anyone will have the time to do what you want. If you really do not understand the code then you should find a simpler sample to work on. If you do understand the code, then paste it into your own compiler and try to work out the changes you need. Come back here if you have specific questions and people will try to help you. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi Richard,
I did do a IOCP project before, and it is still working well. But i wanted to try
something a little different this time to see if the performance would increase drastically.
But im just experiencing a problem with this one, where no matter how i try send a custom reply, it
send out perfectly. But the application then ignores all future recieves from that client. That is the main problem at the moment. I do normally sit down and code it out my own. But i have some time restraints. And thought perhaps someone else has bumped into this problem before. As it is a well know piece of code.
But thanks anycase
Louis
|
|
|
|
|
I have successfully constructed my main application using DLLs.
Now I want to access one sibling DLL from another DLL.
I can compile and link using forward declaration of sibling class:
class OpenHR__DLL_Tabs_COM_;
However, when attempting to allocate memory for the class
pSecondaryTab = new OpenHR__DLL_Tabs_COM_();
I get error C2512: ...' : no appropriate default constructor available.
The DLL of interest can be used by the main application without a hitch.
Any constructive help as always is appreciated.
Thanks
Vaclav
|
|
|
|
|
Could you post the definition of OpenHR__DLL_Tabs_COM_ ? virtual void BeHappy() = 0;
|
|
|
|
|
Standard MFC with AFX_EXT_CLASS macro added, using MFC default constructor:
class AFX_EXT_CLASS OpenHR__DLL_Tabs_COM_ : public CWnd
{
// Construction
public:
OpenHR__DLL_Tabs_COM_();
// Attributes
public:
....
|
|
|
|
|
What error is coming,
when you try to place OpenHR__DLL_Tabs_COM_ cTab; , please ? virtual void BeHappy() = 0;
|
|
|
|
|
Eugen,
when I do this
OpenHR__DLL_Tabs_COM_ test;
I get this error:
error C2079: 'test' uses undefined class 'OpenHR__DLL_Tabs_COM_'
Anyway, check the following exchange with Avi.
I am using the DLLs wrong. It can be done but it is not that simple.
MSDN calls it "Mutual Imports". Here is the link if you are interested:
"http://msdn.microsoft.com/en-us/library/fdy23fx6(VS.71).aspx"
Thanks for your help.
Vaclav
|
|
|
|
|
I can not understand, how it can be possible,
if you have placed #include "..\HeaderOfTab.h" correctly...
(OK, I will read your link, thank you !)
For example: I have implemented the following stage :
TOOLDLL <- EDITDLL <- APPEXE -> TOOLDLL virtual void BeHappy() = 0;
modified on Tuesday, March 16, 2010 10:55 AM
|
|
|
|
|
Eugen Podsypalnikov wrote: For example: I have implemented the following stage Smile :
TOOLDLL <- EDITDLL <- APPEXE -> TOOLDLL
I believe that what Vaclav_Sal was trying was more like:
----------<---------
| |
EDITDLL <- APPEXE -> TOOLDLL
| |
---------->---------
In other words, he wasn't linking one DLL to the other, but was trying to have them use each other by virtue of his knowing that they were both being used by the same exe.Please do not read this signature.
|
|
|
|
|
I'm not sure about your design here. A library provides services to the program that uses it. in general, a dll will not know about, or be able to use anything from a "sibling" dll. I would suggest reconsidering your partitioning into modules so that this is not necessary and you have better encapsulation. Try for independent, service providing modules. If this is not possible, than perhaps these groupings really shouldn't be dlls.
Not necessarily a recommendation, but an alternative might be to make them static libraries.
If this is really necessary, then you could have the first dll dynamically link to the second. (Only one way - I don't really think you want circular references.)
Under some circumstances you might do something with callbacks or passing in a object.Please do not read this signature.
|
|
|
|
|
Thanks Avi.
I think my "problem" is that I am looking at it from user , mechanical , point of view.
The DLL s are "placeholders" for property sheets.
I have a main property sheet with secondary property sheet underneath.
In plain talk - I have a tab control with sub-tabs.
I would like to keep them in separate DLL , and so far they are.
But I am trying to link them because that is the way it looks to the user.
This is where I am wrong, and I need to rebuild it so they are just accessible from the main application only. They are both “connected” to the document anyway and need to communicate only with the document.
Avi , I appreciate your comments, you made me think about my wrong way of approaching this.
You are very helpful.
Thanks
Vaclav
|
|
|
|
|
You're welcome. Thank you for that link in your post to Eugen Podsypalnikov. I didn't know about that possibility.
Vaclav_Sal wrote: They are both “connected” to the document anyway and need to communicate only with the document.
Sounds good to me. Being somewhat simple minded , I prefer to keep things as simple and straightforward as possible. Keep in mind that you will also have to maintain what you create. I've found that locating a problem when data flow is passing between 8 components, as it does in some software I get to maintain, can sometimes be interesting.
Another approach you might consider if you have to notify other windows of some action, but the document's UpdateAllViews() isn't appropriate, is to play "chain of command". Implement a custom message that is sent to the parent window for handling or rebroadcast to siblings of the originator. I've done this with mix-in classes for splitter windows to keep the panes in sync. This has let me reuse views on different tab pages with different - or no - siblings.
Oh, I just noticed your reference to VC++ version 6. Are you aware that the dialect of C++ used in 6.0 is non-standard? You might want to consider shifting your development to a later version that is more standard conforming.
Good luck.Please do not read this signature.
|
|
|
|
|
Hi,
I'm having a small issue with associating the extension of my files with my application.
I'm wanting to use a 2 character extension for my files.
Is this inherently wrong, or should it associate?
My resource string is as follows and seems to be ok
IDR_MAINFRAME "Ext File\nFile\nExt\nInstall Files (*.a1)\n.a1\NewFile.Document\nNewFile Document"
Any ideas?
Tony
|
|
|
|
|
What's the problem?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi David,
When double clicking on a file with a ".a1" extension it doesnt launch my application. I'm assuming therfore that it isnt associated with my application. It also does not display the application icon, which I understood it should.
My complete code, for what it's worth, to load the SingleDocTemplate is as follows
CSingleDocTemplate* pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,
RUNTIME_CLASS(CProgDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CProgView));
AddDocTemplate(pDocTemplate);
IDR_MAINFRAME is as per the original post
Thanks
Tony
|
|
|
|
|
maycockt wrote: When double clicking on a file with a ".a1" extension it doesnt launch my application.
Does HKEY_CLASSES_ROOT\.a1 exist in the registry? If so, does it have a default value?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|