|
there'r 2 cases. one maybe means a "patch" for adding some more resources.
in the other case , i need an entirely new version. my question is about the second case.
so i want to take a solution of reinstallation,though, im not sure whether its resonable or not...
and i cant understand whats ur mean about authoring my msi's.
|
|
|
|
|
Try running the installer with the "\quiet" option. This prevents any user interface.
See: Installer Command Line Options[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
yes,it works.there's also a doubt why i cant run the uninstall .exe if it has a different productcode from setup.msi.
and how can i get the productcode.
thank u for ur reply,its very useful
|
|
|
|
|
If you need to get the product code from the MSI, you could use the tool called Orca.
It's part of the Windows SDK: Orca[^]
You can see the contents of the MSI file with this tool.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
You might want to look into this function:
MsiSetInternalUI[^]
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
I have a self-signed CA Root. An intermediate certificate was signed by this CA Root, and my server is the 3rd level which is signed by the intermediate certificate. What i have is like:
CA Root --> Intermediate Cert --> Server Cert
What i'm using is the function soap_ssl_client_context() to connect to the server and calling its web services. The function soap_ssl_client_context() requires one certificate file with PEM format as the cert file of the server.
The fact i'm facing is that, if i only put the CA Root certificate only (without the intermediate cert and server cert) in the PEM file, all the connection and web service calling are succeed. Is that reasonable? I mean it can pass the verification if only CA Root was provided. Is there anyway to make it verify the full certificate chain instead just the CA root?
The code looks like bellow:
try
{
soap_ssl_init();
soap_init(soap);
if (soap_ssl_client_context(
soap,
SOAP_SSL_DEFAULT,
NULL,
NULL,
"C:\\certfiles.pem",
NULL,
NULL
))
{
isSucceed = false;
}
} catch (...) {
isSucceed = false;
}
Any comment will be appreciated. Thanks.
|
|
|
|
|
|
I do not know why?
one program works with srand(time(NULL));
, but the other one not working.
What do I need to make srand(time(NULL)) work ?
Please help.
|
|
|
|
|
You have to define what you mean by "not working."
Is there a crash? Do you have an error code? What goes wrong?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
i need some help with CRegKey to read from registry
Here what works fine:
<br />
int *target = NULL;<br />
AfxGetApp()->GetProfileBinary(m_strKey, _T("key"), (BYTE **)&target, &bytes);<br />
but i need to do this with registry key, like:
<br />
int *target = NULL;<br />
myregkey.QueryBinaryValue(_T("key"), (BYTE**)&target, &bytes);<br />
Error is allways ERROR_MORE_DATA what means they are more information to read as i do?
To write binary data to registry works fine to, only read is my problem now.
Only for example here how i write binary to registry:
<br />
int *value = new int[count];<br />
myregkey.SetBinaryValue(_T("key"), (BYTE*)value, sizeof(int) * count);<br />
Can somebody help me how to read binary from registry with CRegKey::QueryBinaryValue??
Thanks in advance
bosfan
|
|
|
|
|
ERROR_MORE_DATA usually means your buffer is not large enough. Call the function with a buffer that is large enough to receive the binary value.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi,
thanks for answer, yes the buffer was wrong and i corrected this
and now works.
regards
bosfan
|
|
|
|
|
As per the notes for the RegQueryValueEx function[^]
Quote: If the buffer specified by lpData parameter is not large enough to hold the data, the function returns ERROR_MORE_DATA and stores the required buffer size in the variable pointed to by lpcbData. In this case, the contents of the lpData buffer are undefined. So set your variable bytes to zero and make the call, then when it returns it will contain the required size. You then allocate a buffer of the required size and repeat the call.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
thanks for Answer, you right, i solve it in this way!
I didn know that i can check "the required size"
Now:
<br />
srg.QueryBinaryValue(_T("key"), NULL, &bytes);<br />
int *iArr = new int[bytes];<br />
srg.QueryBinaryValue(_T("key"), (BYTE**)&iArr[0], &bytes);<br />
Now i now how big is the needed size, it is saved in "bytes".
And i have all Data from the registry.
Best regards
bosfan
|
|
|
|
|
int *iArr = new int[bytes];
Your buffer will be 4 (or even 8) times bigger than necessary; you should use:
BYTE *iArr = new BYTE[bytes];
Veni, vidi, abiit domum
|
|
|
|
|
You right again, i change this, but i think if i do this in this way i can call the function
without cast to byte, directly?
Something like this:
<br />
regkey.QueryBinaryData(_T("key"), &iArr[0], &bytes);
i try this and this works to, is there any thing wrong now?
bosfan
|
|
|
|
|
I cannot find a method called QueryBinaryData so I presume you are referring to CRegKey::QueryBinaryValue [^]. You could also use the simpler syntax for your buffer address thus:
regkey.QueryBinaryValue(_T("key"), iArr, &bytes);
The compiler may also still insist that you cast the buffer address to a void* .
Veni, vidi, abiit domum
|
|
|
|
|
Oh no, yes of course i mean QueryBinaryValue my mistake (.
One question now, is there any difference in Unicode Version, my App is in Unicode?
Regards
bosfan
|
|
|
|
|
If the data you are extracting is binary, then no, there is no difference.
Veni, vidi, abiit domum
|
|
|
|
|
I have a client and server MFC applications that uses CSocket. The Server exchanges data with the client 1 through port 1500.
I want to create a new client application entirely different from client 1 which needs to connect to the server but needs entirely different data than that of client 1 which already connects to the Server in Port 1500.
Please suggest me some technical details in terms of port and way of establishing a unique connection with the server.
In case If I connect the 2 clients to the same port where the server is listening, how can I know from the Server code that application (client 1) is requesting a connection and client 2 is requesting a connection.
Please let me know how can I distinguish applications(clients) from Server side?
|
|
|
|
|
Please don't use bold font in your questions, it is considered rude. Also we are all perfectly capable of reading a clearly written question.
As to your problem, there is really nothing much to do other than designing a simple protocol for your clients:
On connect the server starts a new thread which will talk to that client.
The client then sends a request which indicates which data it requires
The server gets the data and sends to the client.
Veni, vidi, abiit domum
|
|
|
|
|
First of all, I apologize for the inconvenience regarding my font usage and I assure that I won't continue that henceforth.
I want to add something to my above question.
1. The Server and client_1 are already developed applications which communicate flawlessly.
2. There may be a multiple client instances of client_1 that may run and get connected to the server and exchange data. So if any of the data changes in the server, the same gets reflected in all of the client instances of client_1.
3. Now I want to add on a new client_2 entirely different from client_1. So any number of client_2 instances may run and connect to the same server to exchange some other set of data.
4. The Server is listening in Port 1500 for eg. Suppose it gets a client request, now how am I from the server side going to recognize the client before calling accept() so that I could route the client accordingly to exchange data.
For Eg: If I know that it is from client_1 I will call SendDataClient1() in a thread. or I will call SendDataClient2() if I know that it is from client_2
Please suggest me with some code to find out a way to differentiate the client_1 and client_2 for the server
|
|
|
|
|
The only way to distinguish, would be to have a listener on a different port. So, client1 types connect to 1500, and client2 types connect to 1501 (for example).
Veni, vidi, abiit domum
|
|
|
|
|
This is my sample code
I have created 2 Socket objects derived from CListenSocket which in turn is derived from CSocket. The 2 sockets listen in 2 different ports as you said. When a client request comes in the CListenSocket, the AcceptClients() in the CMainframe is called. A Client socket pSocket is created. The new client is accepted in which ever port the client tries to connect. In the below eg. the client tries to connect in port no 1500.
But when I debug the code in the function CMainFrame::AcceptClients(), it gets inside the condition
if (m_pSocket->Accept())
and gets lost. whereas it is supposed to get inside the condition
if (m_pSVRLisnSocket->Accept(*pSocket))
Anyone, Please clarify this and suggest me a method to find out a way to distinguish the connection from 2 different ports 1499 and 1500.
Server side code
BOOL CMainFrame::StartServer()
{
PortNo = 1499;
if(!m_pSocket)
{
m_pSocket = new CListenSocket(this);
if ( m_pSocket->Create(PortNo) )
m_pSocket->Listen();
else
AfxMessageBox("Socket creation failed. Failed to communicate with operator station");
}
PortNo = 1500;
if(!m_pSVRLisnSocket) //CListenSocket* m_pSVRLisnSocket
{
m_pSVRLisnSocket = new CListenSocket(this);
if( m_pSVRLisnSocket->Create(PortNo) ) //sandeep1
m_pSVRLisnSocket->Listen();
else
AfxMessageBox("Socket creation failed. Failed to communicate with operator station");
}
}
//Server Listen Socket class
void CListenSocket::OnAccept(int nErrorCode)
{
// TODO: Add your specialized code here and/or call the base class
CSocket::OnAccept(nErrorCode);
m_pFrm->AcceptClients(); //CMainFrame* m_pFrm;
}
void CMainFrame::AcceptClients()
{
COprSocket* pSocket = new COprSocket(this,cId);
if (m_pSocket->Accept(*pSocket)) //CListenSocket* m_pSocket
{
CString curOpr;
UINT i;
pSocket->GetPeerName(curOpr,i);
SendPrelimData(pSocket);
}
else
delete pSocket;
/////////////////////////////////////////////////////////////////////////////////////
if (m_pSVRLisnSocket->Accept(*pSocket)) //CListenSocket* m_pSVRLisnSocket
{
CString sCltIP;
UINT iPort;
pSocket->GetPeerName(sCltIP,iPort);
if (iPort == 1500)
{
AfxMessageBox("INS CLT connected.");
}
}
else
delete pSocket;
/////////////////////////////////////////////////////////////////////////////////////
}
Client Side code
BOOL CMainFrame::ConnectSocket(LPCTSTR lpszAddress, UINT nPort)
{
m_pCLTSocket = new COprSocket(this); //COprSocket *m_pCLTSocket
if (!m_pCLTSocket->Create())
{
delete m_pCLTSocket;
m_pCLTSocket = NULL;
return FALSE;
}
if(!m_pCLTSocket->Connect(lpszAddress, 1500))
{
delete m_pCLTSocket;
m_pCLTSocket = NULL;
return FALSE;
}
}
|
|
|
|