|
Dont bother Richard, he isnt listening.
|
|
|
|
|
You just answered the question yourself. You create a web-server-application (ASP.NET / PHP / CGI / Java etc.) on the same network as the database. Now the web-client-application can access the database through the web-server-application over the internet.
|
|
|
|
|
shanmugarajaa wrote: Kindly anyone suggest or guide me.
Don't do that.
It would require exposing the database to the internet. Although it is possible to expose a database safely to the internet is VERY unlikely that you will succeed at doing it safely.
Instead you write an application which talks to the database. Then your 'clients' talk to the application. This doesn't insure that it will be safe but by limiting functionality you at least narrow the attack venues and with care it can be made safe.
|
|
|
|
|
Hello,
I came across something i don't understand one little bit, and i hope you can help me understand it.
The code is in the function OnDraw with parameter CDC* pDC and i have the following code
rectPreviewClient.SetRect(0, 0, pDC->GetDeviceCaps(HORZRES), pDC->GetDeviceCaps(VERTRES));
...
CDC dc;
dc.Attach(pDC->GetSafeHdc());
And the CRect rectPreviewClientis given to a function which draws some stuff.
The map mode isn't changed and it remains MM_ANISOTROPIC even until the drawing of the elements.
The thing i don't understand is how come i can print stuff for example
dc.TextOut(0, rectPreviewClient.bottom - tm.tmHeight,....)
when its clear the both CDC members have different dimensions.
The dpi's are different pDC have 600 dpi and dc has 96.
If i use GetDeviceCaps(HORZRES) and GetDeviceCaps(VERTRES)on dc i get smaller numbers and yet i can print stuff with a lot higher coordinates.
Note: The dc is used for PrintPreview. Currently i am trying to change the font size and i need to change the map mode to MM_TEXT but when i call TextOut with the coordinates normally used the text is drown outside the CDC. If the MM_TEXT is removed the text is shown but too small
Edit: I fixed the Font size without changing the map mode with CreatePointFont and height of the Font size but the question remains How can i use coordinates from one CDC to another with different dpi and dimensions.
Any help will be appreciated. Thank you in advance.
Microsoft ... the only place where VARIANT_TRUE != true
modified 2-Aug-13 9:22am.
|
|
|
|
|
In a running process say “ProcessOne “
Loaded a module say “DllOne.dll” and calls its exported function say “DllOnesFunction1”
In “DllOnesFunction1” Calls Loadlibray and dynamically loads another module say “DllTwo.dll” and calls it function say “DllTwosFunction2”
In “DllTwosFunction2” Calls Loadlibray and dynamically loads another module say “DllThree.dll” and calls it function say “DllTthreesFunction3”
if so how I can Hook “DllTthreesFunction3” with “MyDllTthreesFunction3”
First whether it is possible ? is start from IAT of “ProcessOne “ Then what ? is EAT of “DllTwo.dll” ...
If possible please give me what way I may start to find answer or just give brief idea or link to learn about it
Expecting a valuable reply, Thanks in advance,
Regards,
Dileep S
|
|
|
|
|
|
A module function may be imported by many other modules. I've used 2 different approaches:
1. I hooked the import table of all modules that imported the function of my interest.
2. If there were too many modules that imported the function then I did the following: I've hooked the function of my interest by writing a jump into the first few bytes of the function that jumps to my code. Of course before the hook code jumps back to the original function it must execute the instructions that have been overwritten by teh jump, depending on the first few instructions you may have to copy more than a few bytes.
Advantages of #1: You don't have to mess around with the instructions of the hooked function like you have to with #2.
Disadvantages of #1: You have to find and hook the import table of all modules that import the specified function.
A possible mistake in both cases: The program may unload/reload hooked DLLs and in this case you have to be aware of this and you have to repatch after reload.
Almost forgot to mention: approach #1 is often called "API redirection". You can find good stuff by googling this.
And another thing I forgot: if it wouldn't be obvious this task is easiest to perform by injecting your own DLL with the hook code into the guest process. Work inside the hookable process and not from outside.
modified 1-Aug-13 7:48am.
|
|
|
|
|
Is it possible by hooking GetProcAddress() function?
Hook GetProcAddress with my myGetProcAddress(). Now myGetProcAddress will be notified on calling GetProcAddress. You can return the address of MyDllThreeFunction on receiving a getprocaddress() for DllThreeFunction.
|
|
|
|
|
Hi,
I am using CPPUNIT code for Unit testing purpose. I have created a Win32-console application to show its output. Now i want to generated TEXT/HTML/ formated file which will contain the excat lines{output} as in console o\p window. Please suggest what should be VC++ code to achive this requirement. Thanks
modified 31-Jul-13 9:55am.
|
|
|
|
|
You just need to use one of the file writing functions or fstream interfaces to write to a file. Check the documentation on MSDN.
Use the best guess
|
|
|
|
|
You can solve this in two different ways: Inside your program or outside your program. The "outside" solution is probably simpler and more roboust and easier to implement.
Outside:
When you are running your program you redirect its output to another program that does the following: prints the incoming data to the console but at the same time it writes it into a text file and of course at the same time it can do other things too with the log data. You can do the redirection either by writing another program that runs the test with redirected input/output or you can choose an easier solution, piping together programs with the help of your cmd or bash:
Example python script that prints the input to console and logs to file at the same time:
file: x.py
import sys
with open('logfile.txt', 'w') as log_file:
while 1:
s = sys.stdin.readline()
if not s:
break
sys.stdout.write(s)
log_file.write(s)
log_file.flush()
Commandline usage:
TestProgram | python x.py
Of course this program could be anything, not only a python script but a perl script or a c/C++ program or a java program.
Inside:
If you want to solve the problem inside your test program then create your own logger and log through that instead of using printf() or similar methods. In your logger you can create many outputs so when your test program logs something your logger can direct it towards different outputs for example a console writer output, a html writer output and a text file writer output.
Almost forgot to mention: If you are on linux or you have cygwin on windows then you can use the tee command that does basically the same as the above python script.
modified 31-Jul-13 12:13pm.
|
|
|
|
|
Hello everybody,
I am trying to convert CString to float using atof(). but its not giving the exact value.
for eg.
CString strVal;
GetDlgItem(IDC_MAXLAYER)->GetWindowText(strVal);
float mVal = atof(strVal);
IDC_MAXLAYER is edit box and in that, i am having the value 386.080, but after atof() conversion, mVal shows 386.07999
is that possible to get exact 386.080 by converting?
Thanks in advance.
A. Gopinath.
|
|
|
|
|
Floating point numbers can not represent all real numbers accurately. Generally speaking: floating point numbers have a precision that is the greatest when the value is near zero. As soon as the whole part of the floating point number contains more and more digits, the fraction part quickly becomes super-inaccurate. Try entering numbers to your editbox like "234224.34654" into your editbox, you will see that the digits in the whole part will "steal" the precision from the fraction part because the value of this number is quite "far from zero". Read some more about floating point numbers:
http://blogs.msdn.com/b/dwayneneed/archive/2010/05/07/fun-with-floating-point.aspx[^].
http://en.wikipedia.org/wiki/IEEE_754[^]
People tend to use floating point numbers as a golden hammer when they don't know about its dark side. Sometimes its better to use just integers or fixed point arithmetic.
|
|
|
|
|
Hello Friends
I am writing to File using FILE object Pointer using fread and fwrite functions.
this is my class:
class Test
{
public:
int a;
int b;
std::vector<int> c;
};
If I don't use vector then it is writing fine and reading too.
But after using vector,its not reading properly if use
fread(&obj,sizeof(Test),1,file);
Do I need to Write separately vectors using std::ostream_iterator and using copy method of STL?
Or is there any way If I Can Write Directly class object in single shot bcoz my class is having too many vectors as member variables.
Regards
Y
|
|
|
|
|
The vector contains just pointers to the actual data stored by the vector. If you write out your struct then you write out just some pointers that will probably be invalid the next time you want to load your data. The serialization method you use is the 0th solution everyone starts with and it works just with primitive types - as soon as you start using complex types like a vector you have to consider using a more sophisticated serialization method. Unfortunately serializing correctly needs more work and a serialization framework. I'm using my own reflection-like framework that is similar to AutoSerial[^] but is more lightweight. If you have reflection info / typeinfo then you can easily write different kind of serializers (binary, xml, ...) that will automatically work with all of your structs and types that have typeinfo attached. In my system I register every serializable member of a struct manually but from that point the struct is serializable as xml, binary, and so on depending on the kind of serialzers I have written. Runtime typeinfo has a bit of perofrmance penalty that matters quite rarely. Some other serializer frameworks do the dirty job with templates and bind to serializable data at compile time with better performance and the third type of serializers generate serializer classes/code for you by parsing your source code. In general I don't like code generators. Another popular serialization framework to check out is boost::serialzation[^].
A serialization framework can have additional benefits compared to a single-shot file-write: It can handle endianness problems and struct member alignment too if you compile the same serializer code on two different machines (in case of a server-client program that serializes data to send over network, or if you transfer the serialized data file to a completely different machine that has different endiannes/compiler struct member alignment).
modified 31-Jul-13 6:54am.
|
|
|
|
|
ok, I understand.
But this library is very old and not compiling,one of header file is missing.
Do we have any other Library for serialization Except Boost ?
Thanks For your Reply.
Regards
Y
|
|
|
|
|
There are probably but I have always used my own creatures for this kind of task so I can't recommend you a good and (I guess) free solution if you don't like boost. Long ago when I checked out the available solutions and I didn't really liked them. Maybe the others can recommend you one or you can use google to search for something that meets your requirement. As a final solution you can write your own framework that is a fun way to learn something new if you have the time and interest.
|
|
|
|
|
Thanks Dear
In case of using AutoSerial, Do I need to include only AutoSerial.h ?
or Something else I need to do. I didn't get from this Docs.
Thanks Once Again.
Regards
Y
modified 31-Jul-13 8:35am.
|
|
|
|
|
You are welcome! Unfortunately I cannot answer this as I used it only once long ago.
Serialization in C++ is a difficult topic. Every solution is messy as serialization isn't really supported by the language. In my opinion it would be very useful to have a bit more detailed runtime type info support in C++ that can be used for serialization. On detailed runtime type info I mean for example auto-generated list of struct/class members, member names, enum member list/member names, ........ On top of such info (that I'm currently putting together manaully in my serialization system) it is quite easy to write reasonably simple yet effective serializers.
I would give boost::serialization a try, that is a quite popular and maintained library.
|
|
|
|
|
Ok, But Boost::Serialization seems to me a heavy library.
It wud be better to have one own and fun to learn a new framework.
Anyway, thanks Buddy For all your replies.
Regards
Y
|
|
|
|
|
You are welcome! I'm also using my own solution because its quite lightweight and provides only a few features I need in a better way. Good luck with creating your own stuff and have fun! Don't forget to take a look around to check out the source code of some existing frameworks to steal good ideas before starting out with your own stuff!
|
|
|
|
|
Are overlapped file writes guaranteed to happen in the order in which they are issued? (On Windows)
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
No.
Although the IRP requests are generally dispatched from a FIFO queue... a call to WriteFile [^] results in a IRP_MJ_WRITE[^] request being sent from the i/o manager down through the filter manager and associated minifilter stack. If any installed legacy, FS or filter driver return STATUS_PENDING for your write request... this would potentially allow other i/o requests to complete out-of-order.
Best Wishes,
-David Delaune
|
|
|
|
|
Wow, thanks. I'm glad you were around to answer this with your knowledge of the driver stack.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Even if the current implementation on your windows version/installation guarantees this order you shouldn't exploit it (for example because this implementation may change in the future if the documentation doesn't explicitly state that it wont). Generally in case of async operations (not only in case of file IO) you shouldn't assume any order in which the async tasks are completed. If an async system doesn't have to guarantee completion order than it has more freedom to perform optimizations. If you have to process the completed async requests in a specified order then its relatively easy to make the result processing ordered.
|
|
|
|