|
There can only be one int main() . You have to separate the code that does the calculations from the code that inquires the input. You have plenty of functions that pass values around, so I don't see why there should be a problem passing these values via a function interface.
|
|
|
|
|
how to return those values using structure or by declaring class
|
|
|
|
|
Change the struct definition to
template<int P> struct encrypt_data_t {
typename Cryptography::EllipticCurve<P>::Point Pa;
FiniteFieldElement<P> c1;
FiniteFieldElement<P> c2;
} ;
Then call this function like this:
int main(...) {
const int MY_P = 263;
...
encrypt_data_t<MY_P> result = my_encrypt<MY_P>();
...
}
Of course, you also have to fix your function code - the code you posted does not declare half the variables it uses.
Or you could just skip that structure and instead pass these values back by reference[^]:
template <int P>
void my_encrypt(typename Cryptography::EllipticCurve<P>::Point& Pa,
FiniteFieldElement<P>& c1, FiniteFieldElement<P>& c2) {
...
}
int main(...) {
const int MY_P = 263;
typename Cryptography::EllipticCurve<MY_P>::Point Pa;
FiniteFieldElement<MY_P> c1;
FiniteFieldElement<MY_P> c2;
my_encrypt(Pa, c1, c2);
}
|
|
|
|
|
I need to develop a tool which peroform all operation on USB drive attached on other computer.
Application needs to perform all operation which can be perform by local compter.
Please guide me how to start and wnat things I need to lookinto?
|
|
|
|
|
Could you clarify which operation you have to perform?
What is USB drive on other computer/local computer?
|
|
|
|
|
|
Once a USB drive is attached to another computer, the drivers will install on the other computer as well.
On this being done and said, you can then access the contents of the USB drive just like any other remote drive.
Not sure what do you mean by "all operation". the above is answered assuming you are querying for copy/paste and other basic functionalities.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
Hi
I am getting the following compiler error in that the compiler can't find filea.cpp
I am using visual studio 2010 professional
The file appear in my project -> source files
When I right click in each of the .cpp source files and compile them Separately they each compile
cleanly including filea.cpp
Is there anyway to tell where this compiler error is coming from
Thanks
|
|
|
|
|
Why is it referring to the file with two elipses (i.e., parent folder) notation?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Don't know here is the actual build output
1>------ Rebuild All started: Project: TunTap32, Configuration: Release x64 ------
1>Build started 6/19/2013 11:45:32 AM.
1>_PrepareForClean:
1> Deleting file "x64\Release\TunTap32.lastbuildstate".
1>InitializeBuildStatus:
1> Touching "x64\Release\TunTap32.unsuccessfulbuild".
1>ClCompile:
1> StdAfx.cpp
1> fishtrace.cpp
1> TT32api.cpp
1> TTAdapter.cpp
1> TunTap.cpp
1> TunTap32.cpp
1> fishtrace.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\fishtrace.cpp': No such file or directory
1> Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.20
|
|
|
|
|
Try removing (but not deleting) the file from your project, and then adding it back in. You should familiarise yourself with rules of projects as this sort of issue can crop up unexpectedly. Open the project file in Notepad (but be careful not to corrupt it) and see how the rules are put together.
Use the best guess
|
|
|
|
|
Look in the project's VCPROJ file for a reference to each of these files. See if you notice anything different about fishtrace.cpp .
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi,
I am using DirectShow to Play / Pause / Stop and Capture Video files. But Capturing and playing of video files is simple. I want to Implement HD Video recording in my project.
Anybody have any idea of how to Implement HD Video Capturing using DirectShow.?
Or Apart from DirectShow, is there any other method to Implement HD Video recording in MFC.
Regards,
Mbatra
|
|
|
|
|
Hi,I need to open a httpfile by Proxy Server,but the UserName and Password I set always fail,I don't know why,I tried many times,I don't know how to do,Can you have any ideas.
Here is My code:
CString strURL = _T("http://www.kkkk.com/");
CInternetSession Session(_T("Get Xml"));
CHttpFile *lpFile = NULL;
try
{
//set proxy info
char sProxyList[MAX_PATH], sProxyName[64],sProxyPassw[64];
strcpy(sProxyName,"mmm");
strcpy(sProxyPassw,"mmm");
INTERNET_PROXY_INFO proxyinfo;
proxyinfo.dwAccessType = INTERNET_OPEN_TYPE_PROXY;
proxyinfo.lpszProxy =_T("192.168.0.1:8080");
proxyinfo.lpszProxyBypass = NULL;
Session.SetOption(INTERNET_OPTION_PROXY,(LPVOID)&proxyinfo,sizeof(INTERNET_PROXY_INFO));//Success
if (! Session.SetOption(INTERNET_OPTION_PROXY_USERNAME, sProxyName, strlen(sProxyName)+1))
{
DWORD ret = GetLastError();//Always return 12018.Why?
}
if (! Session.SetOption(INTERNET_OPTION_PROXY_PASSWORD, sProxyPassw, strlen(sProxyPassw)+1))
{
DWORD ret = GetLastError(); //Always return 12018.Why?
}
}
lpFile = (CHttpFile*)Session.OpenURL(strURL,1,INTERNET_FLAG_TRANSFER_ASCII|INTERNET_FLAG_RELOAD|INTERNET_FLAG_DONT_CACHE);
if (lpFile != NULL)
{
while(TRUE)
{
char szBuff[1024] = {0};
if ( lpFile->Read(szBuff, 1024) <= 0)
{
break;
}
strContent += szBuff;
}
}
}catch(CInternetException* pEx)
{
TCHAR pszError[64];
pEx->GetErrorMessage(pszError, 64);
strErrorMsg = pszError;
pEx->Delete();
}
delete lpFile;
lpFile = NULL;
Session.Close();
|
|
|
|
|
Error code 12018 is described here[^].
Use the best guess
|
|
|
|
|
Hello, i have a question about the MSXML library. I fail to find how exactly they read the XML Document when its already loaded into memory. If i look for XML nodes do they read the whole document from top to bottom until find it or its something with hash tables.
My problem is that i have to remove some elements for existent XML document and add it in another. I was wondering which is better(according to speed) to keep the XML Nodes in std::vectors and remove the needed items and put them in the new XML Document and this only with 2 read/write operations on the XML Document or i should get the first part of the items do whatever i have to do with them and then take the next part and so on. This will cause for at least 8 times reading the existent XML Document and getting XML NodeLists out of it. The problem here is that the first XML Document can be really big.
I think its better to read the information only once and do what i have to do with it and then write it in the new XML Document. At least i think its gonna be faster but i am not sure exactly how MSXML does the operations on the XML Document.
Thank you for your help.
|
|
|
|
|
Argonia wrote: I fail to find how exactly they read the XML Document when its already loaded into memory. Did you look at the selectSingleNode() method?
Argonia wrote: My problem is that i have to remove some elements for existent XML document and add it in another. So why not let MSXML do this for you? For a given node (see IXMLDOMNode), use the removeChild() method.
Argonia wrote: ...but i am not sure exactly how MSXML does the operations on the XML Document. While there are certainly better and more exhaustive examples available, I show how to briefly use MSXML 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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
DavidCrow wrote: Did you look at the selectSingleNode() method?
My question is what is in this function.
DavidCrow wrote: So why not let MSXML do this for you? For a given node (see IXMLDOMNode), use the removeChild() method.
I can't change the given XML Document. I have to get some of the nodes of the first and add them to the second Document .
|
|
|
|
|
Argonia wrote: My question is what is in this function. Unless I had access to the source code, I wouldn't have a clue (nor would I care). If I were to surmise a guess, the class has some private member variable (e.g., file pointer or handle) that keeps track of when a file has been read or not.
Argonia wrote: I can't change the given XML Document. I have to get some of the nodes of the first and add them to the second Document . You can either remove unwanted nodes from the first and write the balance to the second, or copy wanted nodes from the first to the second. The net result would be the same.
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I want to make an Active X ctrl that communicates with a device and then sends data to main program. I want to know that Does activex work as seperate process. Does main program waits on ActiveX ctrl or I can do sperate processing simultaneously in my main program.
Thanks in advance.
|
|
|
|
|
As the name ActiveX CONTROL suggests that it is a control you will need something (some app) to host it. You can call the activex's functions from the host which can be an executable.
ActiveX doesn't work as a separate process.
Does main program waits on ActiveX ctrl or I can do sperate processing simultaneously in my main program.
This depends on the implementation.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
|
I am using vc++ 6.0. I Have made an unlicensed activex ctrl application from app wizard (MFC activeX ctrl wizard for generating random drawing). When I am testing this Activex by ActiveX control test container, all functions are working fine, but when I am testing it with dialog application, On calling any method of ActiveX it is giving error debug assertion failed. Program ......
File: winocc.cpp; line: 345
I am making an object of this ActiveX ctrl wrapper class in my testing dialog application and then calling method defined in this ActiveX ctrl.
My code:
CNewSquiggleAcX m_ClNewSquigg;
CFileDialog m_ldFile(TRUE);
// Show the File open dialog and capture the result
if(m_ldFile.DoModal()== IDOK)
{
CString m_sResults;
m_sResults = m_ldFile.GetFileName();
//m_ClNewSquigg.GetSquiggleLength();
m_ClNewSquigg.LoadDrawing(m_sResults); // Error comes in this line calling any activex function
}
Calling any method of this self created unlicensed ActiveX ctrl is giving error.
Please help.
|
|
|
|
|
I need to achieve a functionality but do not know how to start please guide:
Functionality:
USB Data Card (like internet data card) is attached with system A, system A is recognising device as USB device but I need to use that card using system B which is having all drivers of data card.
How to achieve it?
|
|
|
|
|
You cannot have the device in one system and the drivers in another.
Use the best guess
|
|
|
|