|
In a similar way as i described in reply to your question entitled:
"How to disable USB Port/Drive permanently?"
registry, registry once more registry ......
|
|
|
|
|
Hi,
I have a client/server application which I have implemented using CSockets using serialization (as per Microsoft help on CSockets). This works really well, but the customer is now asking to be able to access to the server application using his web browser rather than my custom built client and I havent a clue as to how easy/hard this is going to be.
Anyone have some suggestions of what I would need to do to create web pages that request info from my server, and what changes I would need to make to the server?
Thanks.
Tony
|
|
|
|
|
|
Can you rewrite your server application as an ISAPI Extension[^] and just use IIS?
|
|
|
|
|
we can put the application in startup but its not the preferable method, Is there any better way of running an application at windows startup?
Suggestions are appreciated.
|
|
|
|
|
You can edit Windows registry:
RootKey="HKEY_LOCAL_MACHINE"
OpenKey= "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"
or
OpenKey= "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"
for running an application once at win startup
Add new REG_SZ value type, which data is the path for your application
I've tried it with Win 2000
|
|
|
|
|
Thank you newbie its quite useful.
|
|
|
|
|
You can also use the root HKEY_CURRENT_USER with the same keys if you want to limit the app to a specific user. Also avoids the security issues around apps not being able to write to HKEY_LOCAL_MACHINE.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
|
Super Hornet wrote: Is there any better way of running an application at windows startup?
Make it a Windows Service[^] There is a C++ Application Wizard that supplies a starter project for a Service.
led mike
|
|
|
|
|
Hi,
I'm using MFC extension dll.
I've 2 questions.
1. Why do i get exception while trying this:
char* s1 = "";
char* s2 = abc";
strcpy(s1,s2); //exception
But if i try this it works:
char s1[255];
char* s2 = abc";
strcpy(s1,s2);
Why is this so?
2. I've an exposed function BOOL _stdcall SetName(CString& name)
There is a function defined in another class but in same dll as below.
void CMyClass::Myfn(CString& str)
{
m_str = str;
}
where m_str is CString variable declared in header and initialized as
m_str = "" in CMyClass constructor.
I create an object of CMyClass and call Myfn() in SetName.
SetName is called from a vb.net application.
I get exception while assigning m_str = str in Myfn();
(This works fine if i'm calling the dll from an MFC application.)
I solved the problem by making the following changes.
m_str declaration as char m_str[255] and removed initialization from constructor.
Myfn() as
void CMyClass::Myfn(char* str)
{
strcpy(m_str,str)
}
But how did it work? Will it create problem in anyother scenario?
Thanks & Regards,
sanju
|
|
|
|
|
s1 has not enough space to write the content of s2 in it
|
|
|
|
|
For the second question (tox already answered the first): this is simply due to the fact that a CString class (yes, it is a class) is not compatible with whatever VB uses to represent a string.
|
|
|
|
|
1. sanjutvm wrote: Why is this so?
because you've only allocated one byte for s1.
2. just guessing here... tough to say based on what you've shown us. but i doubt vb.net knows anything at all about MFCs CString class. generally, when exposing functions to be called from other languages, it's best to stick to primitive types:
BOOL _stdcall SetName(const char *pName)
{
Myfn(pName);
}
|
|
|
|
|
Hi All,
Thanks for the reply.
How do I perform strcpy on two char* variables?
Thanks & Regards,
sanju.
|
|
|
|
|
you simply have to assure that the destination buffer is large enough to hold the source.
|
|
|
|
|
Hi,
Thanks for the reply.
That means i cannot simply use char* as destination in strcpy. I'll have to use char* s = new char[some value].
Thanks & Regards,
sanju.
|
|
|
|
|
correct. or, if you know your strings will always be smaller than a certain size, you can use something like:
char buf[MAX_SIZE];
strncpy(buf, inputString, MAX_SIZE-1)
|
|
|
|
|
Hi,
Thank you.
Thanks & Regards,
sanju.
|
|
|
|
|
Hello,
I need a class which I can work with a huge floating point numbers and make an operations with them like *-/+
for example: 122354554654549878987.003253265465454597 * 65465465456654564.3212154654
I need something like this http://www.codeproject.com/cpp/largenumber.asp[^] but with floating point numbers.
Is there any class like I want?
SnaidiS(Semion)
|
|
|
|
|
Why won't you use long double type?
|
|
|
|
|
a little Googling turns up a few high-precision floating point libs for C++.
|
|
|
|
|
|
it says it can handle numbers in the range: 2^16384 > x > 2^[-16383]
that's far greater than the numbers you gave in your post
|
|
|
|
|
I have problems with the files.
I added the src folder to the project like that:
Tools->Options->Projects And Solutions->VC++ Directories-> and to included files and source files.
I'll show you here the most important code:
<br />
#include "stdafx.h"<br />
#include "num.h"<br />
#include "numDlg.h"<br />
#include "stdio.h"<br />
#include "xpre.h"<br />
<br />
<br />
BOOL CnumDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
CnumDlg::play();<br />
<br />
<br />
return TRUE;
}<br />
<br />
<br />
void CnumDlg::play()<br />
{<br />
struct xpr s;<br />
int i,n;<br />
<br />
s=xZero;<br />
do<br />
{<br />
scanf("%d",&n);<br />
s=xZero;<br />
for(i=0;i<=n;i++)<br />
s=xadd(s,xpr2(xOne,i),0);<br />
xprxpr(s,30);<br />
putchar('\n');<br />
}while (n>0);<br />
}<br />
I earased the most of the code-just the important there.
After I'm running the program I have the following Errors:
1>numDlg.obj : error LNK2019: unresolved external symbol _xprxpr referenced in function "public: void __thiscall CnumDlg::play(void)" (?play@CnumDlg@@QAEXXZ)<br />
1>numDlg.obj : error LNK2019: unresolved external symbol _xadd referenced in function "public: void __thiscall CnumDlg::play(void)" (?play@CnumDlg@@QAEXXZ)<br />
1>numDlg.obj : error LNK2019: unresolved external symbol _xpr2 referenced in function "public: void __thiscall CnumDlg::play(void)" (?play@CnumDlg@@QAEXXZ)<br />
1>numDlg.obj : error LNK2001: unresolved external symbol _xOne<br />
1>numDlg.obj : error LNK2001: unresolved external symbol _xZero<br />
1>C:\Documents and Settings\Semion Naidis\My Documents\Visual Studio 2005\Projects\num\Debug\num.exe : fatal error LNK1120: 5 unresolved externals
How can I fix that?
SnaidiS(Semion)
|
|
|
|