|
Assuming you need a DLL or LIB.
Create a new project using Visual Studio: File->New->Project->Smart Device->Win32 Smart Device Project.
Then select the platform and in the Project Settings page of the wizard there is an option to Select DLL or LIB.
|
|
|
|
|
Hi i have already created project , i need to crete Library of that Existing project.How i dont know, for your informaiotn it will open new empty project.
|
|
|
|
|
There's no (AFAIK) 'Covert To Library' wizard, so you have to follow the suggested steps: create a DLL (or LIB ) project and then add (with appropriate modification) the existing sources.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There's no easy way to "convert" an application to a library. These are two different things.
The only way is to create a new library project, and add to it the source files you want to include in your library. Of course if you want to bring functionalities that were present in the GUI classes (like in View or Document if you use a SDI application), that will require more work.
But first, you need to understand what a library is and how it is used, because it seems you are a bit confused about it.
What are you trying to achieve exactly ? Converting a full application into a library doesn't make sense at all.
|
|
|
|
|
Hi!
I've to read from an already existing text file. I've writen the following code.
if(countryCode == 0 && idBtn == 0)
{
ifstream myfile;
char* line = " ";
std::string filename = "E://Work//Data//playerdata.txt";
myfile.open(filename.c_str(),ios_base::in);
fstream test;
test.open("E://Work//Data//test.txt", ios_base::out);
if(!myfile.is_open())
{
printf("Opening File %s Failed!",filename.c_str());
}
while(!myfile.eof())
{
myfile.read(line, 1);
test.write(line, 150);
}
myfile.close();
test.close();
pManager->getGUIEnvironment()->addStaticText(L"Sachin's Details", rect<s32>(20, 50, 180, 80),false, true, m_pTestTab, -1, true);
}
This prints only this statement "Opening File Failed!". Why is it printing like that?
|
|
|
|
|
Try using backslashes (\\) instead of forward slashes (//).
|
|
|
|
|
Hi!
Using backslash also produces the same reult. What to do?
|
|
|
|
|
Are you able to manually open the file and view its contents?
|
|
|
|
|
Yes. It contains a 55 row of numbers separated by commas. I produce first 5 rows of my file's content.
0,79,76,6,2222,126,1,15,23,88,88,6,14,"3/9",0
1,79,76,6,2222,126,1,15,23,88,88,6,14,"3/9",0
2,79,76,6,2222,126,1,15,23,88,88,6,14,"3/9",0
3,79,76,6,2222,126,1,15,23,88,88,6,14,"3/9",0
4,79,76,6,2222,126,1,15,23,88,88,6,14,"3/9",0
5,79,76,6,2222,126,1,15,23,88,88,6,14,"3/9",0
I've to read a single line at a time. I then have to store each value to a structure element.
|
|
|
|
|
Check the attributes of the output file test.txt if it already exists. Check if it is read only.
|
|
|
|
|
|
Is it possible to do a GetLastError() or _get_errno() and see the error code?
|
|
|
|
|
When I print the
GetLastError() , it prints 183.
|
|
|
|
|
Use errlook to check the meaning of error codes. In this case 183 means: Cannot create a file when that file already exists. Either add options to recreate the file even if it exists, or ensure that your filename is unique.
It's time for a new signature.
|
|
|
|
|
A couple of things to consider...
- why are you calling open()? It's more common to see something like:
std::ifstream input( "c://test.txt" );
if( input )
{
std::string text;
std::getline( input, text );
}
- Don't bother manually closing the file - it's completely pointless
- Are you sure you want to read one character from a file then try and write 150? Especially into something that's a constant block of memory.
None of these things explain why the file isn't being opened. The Error number you're getting seems to imply the file already exists which is an error I'd expect from trying to open an ofstream. Are you doing the GetLastError immediately after calling myfile.open()?
Cheers,
Ash
|
|
|
|
|
T.RATHA KRISHNAN wrote: std::string filename = "E://Work//Data//playerdata.txt";
Try:
std::string filename = "E:/Work/Data/playerdata.txt";
or
std::string filename = "E:\\Work\\Data\\playerdata.txt";
"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
|
|
|
|
|
Hello,
I'm using a small program that notify me when a file size change inside a directory. The program worked perfect under Win XP, now in Windows 7 the size changes are ignored for long periods and notifications are not in sync with the changes.
At first glance that could be seen as something related to caching/flushing differences between XP and Win 7 but I verified that the file I'm monitoring is being flushed to the disk and is not staying in cache.
I used the command tail -f monitoredfile.txt displaying the file content as it is updated and I was able to see all the changes in real time but my monitor program wasn't reporting any file size change.
This is the monitor program:
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <tchar.h>
void RefreshDirectory(LPTSTR);
void RefreshTree(LPTSTR);
void WatchDirectory(LPTSTR);
int _tmain(int argc, TCHAR *argv[])
{
if(argc != 2)
{
_tprintf(TEXT("Usage: %s <dir>\n"), argv[0]);
return 1;
}
WatchDirectory(argv[1]);
}
void WatchDirectory(LPTSTR lpDir)
{
DWORD dwWaitStatus;
HANDLE dwChangeHandles[2];
TCHAR lpDrive[4];
TCHAR lpFile[_MAX_FNAME];
TCHAR lpExt[_MAX_EXT];
_tsplitpath_s(lpDir, lpDrive, 4, NULL, 0, lpFile, _MAX_FNAME, lpExt, _MAX_EXT);
lpDrive[2] = (TCHAR)'\\';
lpDrive[3] = (TCHAR)'\0';
dwChangeHandles[0] = FindFirstChangeNotification(
lpDir,
FALSE,
FILE_NOTIFY_CHANGE_SIZE);
while (TRUE)
{ printf("\nWaiting for notification...\n");
dwWaitStatus = WaitForMultipleObjects(1, dwChangeHandles, FALSE, INFINITE);
switch (dwWaitStatus)
{
case WAIT_OBJECT_0:
_tprintf(TEXT("Directory (%s) changed.\n"), lpDir);
if (FindNextChangeNotification(dwChangeHandles[0]) == FALSE)
{
printf("\n ERROR: FindNextChangeNotification function failed.\n");
ExitProcess(GetLastError());
}
break;
default:
printf("\n ERROR: Unhandled dwWaitStatus.\n");
ExitProcess(GetLastError());
break;
}
}
}
|
|
|
|
|
It probably is a permission issue.
Try running the program from an elevated command prompt.
|
|
|
|
|
I tried with UAC OFF and ON, running as admin, etc. it's more related to a caching issue I guess. In the meanwhile I found a turnaround that made it work, I run a script on the background that apply the touch command every 100ms or so to the file I'm monitoring, it seems it forces a flush and then the changes are detected by my program...
Maybe that will give more clues to find a better solution.
Thanks,
|
|
|
|
|
Does argv[1] refer to a remote computer? Do you have the "backup file and directories" privilege?
"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
|
|
|
|
|
argv1 refers to the directory you want to monitor i.e. monitor c:\tmp
|
|
|
|
|
auriga19 wrote: argv1 refers to the directory you want to monitor i.e. monitor c:\tmp
I'm full aware of that. When FindFirstChangeNotification() fails to receive notification, does argv[1] refer to a remote computer?
"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
|
|
|
|
|
No, it refers to a directory on the local computer.
|
|
|
|
|
Ok, then the redirector is likely not the problem.
Just for grins, did you enable the "backup file and directories" privilege?
"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
|
|
|
|
|
I just checked, I have those privileges enabled.
|
|
|
|
|