|
I am creating a software suite that will involve mobile platforms along with multiple operating systems
I am mostly efficient in c/c++/c# along with socket communication.
I originally designed the software to use TCP communication to relay information between the "base" application and the client applications.
However I am missing a crucial step in the design... I am not sure how to "connect" to this server or base computer I have a domain name that I can use, but how is it that I relate that information to the server application? I want this server app to be in c# .net, but am willing to migrate to a different solution if deemed easier. Is there a js script that I can make that will do this for me?
For more info on the type of application this is.. think of it like a IM program that the server must know all the clients connected and send global messages to
--addition
I can think of one solution but it truly seems very inefficient
I can have a file on my server and every 30seconds on a worker thread check for connected devices, when a client system connects to the server it registers itself on the list
-- or
when the server comes online the server stores its IP information in this file, when a client comes online it checks this file for the servers IP information and then creates a socket based on the information in the file to communicate with the server
Suggestions, comments are greatly appreciated!
modified on Sunday, June 27, 2010 7:56 PM
|
|
|
|
|
Greg Mort wrote: I am mostly efficient in c/c++/c# along with socket communication.
Greg Mort wrote: However I am missing a crucial step in the design... I am not sure how to "connect" to this server
Surely some contradiction here. If you understand sockets then just use socket connection, standard client server application.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: Surely some contradiction here. If you understand sockets then just use socket connection, standard client server application.
uh...
you clearly don't see the issue, so thanks but no thanks
For anyone that is willing to help I do greatly appreciate it, to be a little more specific...
It is not a simple intranet connection that I am trying to create
I have a domain name that I can use, this domain name has a dynamic IP and I do not have any server type applications on this domain name I have a computer (not affiliated with the domain) that represents my server application. I have multiple client applications that reside on mobile phones and other computers. These client applications need to be able to know how to connect to the server without knowing the exact IP of the servers computer because it will always be changing. That is why I suggest this file system on my domain name where when a server computer is running it updates the domains server file with its IP information that way a client can access this file and connect to the appropriate IP address.
Greatly Appreciated
Thank you
Greg
|
|
|
|
|
Hi,
How to resize property sheet button?
|
|
|
|
|
|
Hello,
I have a problam : my program is work well at windows xp but not at
windows 7 (I'm opening a file to write and read).
I created a manifest with:
<ms_asmv2:trustinfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
<ms_asmv2:security>
<ms_asmv2:requestedprivileges>
<ms_asmv2:requestedexecutionlevel level="requireAdministrator">
<ms_asmv2:requestedexecutionlevel>
<ms_asmv2:requestedprivileges>
<ms_asmv2:security>
<ms_asmv2:trustinfo>
I added the manifest to the project by:
Properties->Manifest Tool->Input and Output
and adding the name of the manifest file under Additional manifest files.
(I followed the MSDN instructions "Create and Embed an Application Manifest (UAC)")
but its don't work , does anyone can halp me with this?
thanks
|
|
|
|
|
Project settings -> Linker -> UAC-Level.
Better is writing your file to the user dir.
Remember: you cant access the dir that you dont own.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Thank you, it's work wall this way, can you give me more detail about
"Better is writing your file to the user dir.
Remember: you cant access the dir that you dont own"
I'm a new programer.
thanks again
|
|
|
|
|
I found an article from the legendary Mark Russinovich:
http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx
which is really worth reading and understanding. Believe me investing one or two hours to understand it is good invested time. You wont regret it, thats how Windows works.
Or this one
http://www.codeproject.com/KB/vista-security/UAC__The_Definitive_Guide.aspx
in which I found the link.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
A class is sub of CPropertyPage.
Several classes are sub of the class.
code looks like:
class Base : public CPropertyPage
{
enum { IDD = PAGE_BASE };
};
class Sub0 : public Base
{
};
class Sub5 : public Base
{
};
Non-default constructor of class Base, such as Base(int iType), needs to be used to identify sub classes of Sub0 - sub5.
For this reason,
DECLARE_DYNCREATE(Base)
and
IMPLEMENT_DYNCREATE(Base, CPropertyPage)
have to be deleted.
Is it harmful if deleting the 2 pieces of code?
|
|
|
|
|
I dont think so. Comment them out, if you need them later.
If you use the macros, they should implemented in EVERY class properly.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hello Includeh10,
I would like to ask a few usage policy and quesions on the barcode application you developed and posted on Code Project site in Mar 2006. Could you please respond by Test E-mail?
Looking forward to hearing from you.
Best regards,
-/Madhav
|
|
|
|
|
I'm trying to create a RichEdit without any borders tried to set off ES_SUNKEN, WS_EX_CLIENTEDGE but nothing works: it keeps coming with that ugly sunken border. Has anyone a clue, or better, an example in C or C++?
PS. of cource ES_MULTILINE,ES_AUTOHSCROLL,ES_AUTOVSCROLL are on...
Thanks in advance...
Rozis
[Update]
I found out i was still using version 1. Did some changes to support version 3 and 4.1. Because the control displays correctly (apart from that ugly border) I conclude this code must be ok. WS_EX_CLIENTEDGE ultimatly leads to SetWindowLong(). So I thought to be smart and set everything off, like this:
SetWindowLong(whnd,GWL_EXSTYLE,0)
To my surprise it still displays the border! What i want to get rid off is WS_BORDER, WS_EX_CLIENTEDGE and WS_EX_STATICEDGE.
For version 4.1 I use Loadlibrary("MSFTEDIT.DLL") and classname "RichEdit50W". The MS-documentation says not all styles are implemented, so i thought maybe it is not possible. Your reactions indicate i'm not right... But i still can get it to work.
Someone any (win32) suggestions?
[Solved]
Used Spy+ to find out wich styles where there. Used Setwindowlong() to put the styles in. I think this was a quirk of my gui-classes
Thanks anyway
[End Update]
modified on Friday, July 2, 2010 4:15 PM
|
|
|
|
|
This works ok over here
...
AfxInitRichEdit2();
...
DWORD dwStyle = ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_TABSTOP | WS_VISIBLE;
CRect rc(200, 200, 600, 600);
wndRichEdit.Create(dwStyle, rc, pWndParent, 30000);
If you create the control in the resource editor, all you have to do is set Border to false
|
|
|
|
|
And what about WS_EX_CLIENTEDGE and WS_EX_STATICEDGE?
|
|
|
|
|
What about them? Did I maybe misunderstand your problem?
The code I supplied creates a CRichEditCtrl without any borders at all. I tested it on my end. Was that not what you wanted?
|
|
|
|
|
Look there http://msdn.microsoft.com/en-us/library/bb787873(VS.85).aspx
I guess that your form style like win98. To turn on XP or later versions style, include this code:
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\""
#endif
|
|
|
|
|
I'm not using MS-stuff. Do you know if there's a win32 equivalent?
Thanks, Rozis
|
|
|
|
|
Hi sir
I have some strings which i am reading from database.
I want to comapare the strings with the given character and sort it Alphapatecially
For example if the given character input is "s".it should compare with the
given strings and get the result only with "s".
For example the strings are aa,bb,cc,ss,sss,sss
It should compare and get ss,sss,sss.
Any easy way or any help appreciated
Thanks
Raj
|
|
|
|
|
You have two possibilities: When extracting from the database ignore all strings that do not match the prefix character. Alternatively when sorting filter out all strings that do not match before sending to the sort function.
It's time for a new signature.
|
|
|
|
|
Dear You should handle by database query with using "where" and assending statment .
|
|
|
|
|
If you only want the strings for one purpose then it's probably more efficient to lean on your RDBMS and let it do the filter and sort for you. If, on the other hand, you want the strings for a variety of groovy purposes then you can filter them on the client side using a couple of algorithms from the C++ standard library:
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <iostream>
std::vector<std::string> create_test_data()
{
std::vector<std::string> strings;
strings.push_back( "aa" );
strings.push_back( "bb" );
strings.push_back( "cc" );
strings.push_back( "ss" );
strings.push_back( "sss" );
strings.push_back( "sss" );
std::random_shuffle( strings.begin(), strings.end() );
return strings;
}
void print( const std::vector<std::string> &data, std::ostream & to )
{
std::copy( strings.begin(), strings.end(), std::ostream_iterator<std::string>( to, "\n" ) ) << std::endl;
}
int main()
try
{
std::vector<std::string> strings( create_test_data() );
print( strings, std::cout );
strings.erase(
std::remove_if(
strings.begin(),
strings.end(),
[]( const std::string &str ){ return str.front() != 's'; } ),
strings.end() );
std::sort( strings.begin(), strings.end() );
print( strings, std::cout );
}
catch( std::exception &e )
{
std::cout << "Something went wrong: " << e.what() << std::endl;
}
catch( ... )
{
std::cout << "Something went wrong, no idea what!" << std::endl;
}
The two important lines are:
strings.erase(
std::remove_if(
strings.begin(),
strings.end(),
[]( const std::string &str ){ return str.front() != 's'; } ),
strings.end() );
std::sort( strings.begin(), strings.end() );
as they're the lines that filter and sort the strings.
The first one removes any string that doesn't start with an 's' character. I've used a lambda to do the comparison - if you're not using a very up to date compiler you might have to replace that with a function object. Holler if you need some help. As remove_if has some funky behaviour (it can't resize the range it's filtering) you have to resize the vector - which is what erase is doing. Have a look at "Effective STL" by Scott Myers for a good treatment of why this happens.
The second line just sorts the remaining strings into alphabetical order.
Hope this helps, please scream if you need more help with this and don't decide SQL is the way to go!
Cheers,
Ash
Edited to play around with formatting a bit...
modified on Saturday, June 26, 2010 10:11 AM
|
|
|
|
|
raju_shiva wrote: I want to comapare the strings with the given character and sort it Alphapatecially
Wasn't sorting working here?
"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!
When I execute my program, my application window opens and closes in a sudden. Then a window called
Data Execution prevention window opens. If click that window it has the following data:
Problem signature:
Problem Event Name: BEX
Application Name: CricCEGUI.exe
Application Version: 0.0.0.0
Application Timestamp: 4c259f04
Fault Module Name: StackHash_4930
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 00000000
Exception Offset: 01079340
Exception Code: c0000005
Exception Data: 00000008
OS Version: 6.0.6002.2.2.0.256.1
Locale ID: 1033
Additional Information 1: 4930
Additional Information 2: b5c2ee444cce2fcc0c63bdde408d8084
Additional Information 3: b9dd
Additional Information 4: c9f8be406ff0c0f9c077c4f309046cec
What does this mean? How do I run my application without crash?
|
|
|
|
|