|
You must insert library Kernel32.lib to your project
-----------------
conglt
|
|
|
|
|
The linker is looking for the entry point for a console application, but the application is being compiled and linked as a windows application (i.e. not a console application).
This error has been observed after changing the project settings from using MBCS to UNICODE characters.
Under the project settings, under the ‘Link’ tab, category ‘output’, set the ‘Entry-point symbol’ to ‘wWinMainCRTStartup’.
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks a lot. It works!
But there's still a little problem:
When I use the external thread, the command line interface appears for a short time. how can I suppress the command line?
|
|
|
|
|
MrChefman wrote: ...the command line interface appears for a short time.
You mean the console window? Have you tried using ShellExecute(..., SW_HIDE) , or setting STARTUPINFO.wShowWindow to SW_HIDE if using CreateProcess() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
It seems I come here with the strangest questions sometimes... but here goes.
Is there a way for my C++ app on my client to be recognized as present by my web app?
---
I install my app
I browse to my remote website
... can the web app detect that my app is installed?
... would prefer this not to be IE dependent....
Thanks for your thoughts!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Peter Weyzen wrote: Is there a way for my C++ app on my client to be recognized as present by my web app? \
if you cpp application can send query the web app?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I was kinda looking for a javascript-ish way or something like that....
but maybe communication from the client could be enough information to make the webserver know that "this machine" is where the client is installed?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Peter Weyzen wrote: but maybe communication from the client could be enough information to make the webserver know that "this machine" is where the client is installed? .
I am afraid, i fail to understand you problem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to be able to browse to my website -- and have the webpage behave differently if my application is installed on this machine. I would like additional links to show up when it's installed here... or have the webpage figure out this is my home machine....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
hai to all
i have created a thread function
void ThreadRoute1( void* arg )
{
USES_CONVERSION;
HANDLE hDir = CreateFile( "C:\\", // pointer to the file name
FILE_LIST_DIRECTORY, // access (read/write) mode
FILE_SHARE_READ|FILE_SHARE_DELETE, // share mode
NULL, // security descriptor
OPEN_EXISTING, // how to create
FILE_FLAG_BACKUP_SEMANTICS, // file attributes
NULL // file with attributes to copy
);
FILE_NOTIFY_INFORMATION Buffer[1024];
DWORD BytesReturned;
while( ReadDirectoryChangesW(
hDir, // handle to directory
&Buffer, // read results buffer
sizeof(Buffer), // length of buffer
TRUE, // monitoring option
FILE_NOTIFY_CHANGE_SECURITY|
FILE_NOTIFY_CHANGE_CREATION|
FILE_NOTIFY_CHANGE_LAST_ACCESS|
FILE_NOTIFY_CHANGE_LAST_WRITE|
FILE_NOTIFY_CHANGE_SIZE|
FILE_NOTIFY_CHANGE_ATTRIBUTES|
FILE_NOTIFY_CHANGE_DIR_NAME|
FILE_NOTIFY_CHANGE_FILE_NAME, // filter conditions
&BytesReturned, // bytes returned
NULL, // overlapped buffer
NULL// completion routine
))
{
CTime tm = CTime::GetCurrentTime();
CString helper_txt;
switch(Buffer[0].Action)
{
case FILE_ACTION_ADDED: break;
case FILE_ACTION_REMOVED:break;
case FILE_ACTION_MODIFIED: break;
case FILE_ACTION_RENAMED_OLD_NAME: break;
case FILE_ACTION_RENAMED_NEW_NAME: break;
}
int i=0;
do
{
m_Sec.Lock();
int item = pList1->InsertItem(pList1->GetItemCount(), CString(Buffer[i].FileName).Left(Buffer[i].FileNameLength / 2) );
pList1->SetItemText(item, 1, tm.Format("%Y/%m/%d/ - %H:%M:%S"));
i++;
m_Sec.Unlock();
}
while (!Buffer[i].NextEntryOffset);
}
}
i have called the thread by using a button click function.when i click the button the followinf function works
_beginthread( ThreadRoute1, 0,0 );
here i have a problem .the problem i need to pass a directory path which i have written in a edit box .how can i pass that path to the thread function which i created
please help me to solve this problem
|
|
|
|
|
hi
u can pass a void pointer parameter to thread by _beginthread() function.
_beginthread() syntex:
_beginthread(threadname, stack_size, void *parameter);
in ur case,
_beginthread(ThreadRoute1, 0, (void *)filepath);
In thread():
void ThreadRoute1( void* arg )
{
char *filepath;
filepath=arg;
.........
........
}
By
Parthiban
|
|
|
|
|
hai parthiban
thanks for ur reply.
but a small problem is there
an error is coming when i do this.
can u rectify it.
error C2440: '=' : cannot convert from 'void *' to 'char *'
|
|
|
|
|
C++ (unlike C) has to implicit converion from void* . Use explicit conversion:
char *pFilePath = reinterpret_cast<char*>(arg);
Steve
|
|
|
|
|
struct DataYouWantToPass
{
CString AString;
int ANumber;
};
DataYouWantToPass *pData = new DataYouWantToPass;
_beginthread(ThreadRoute1, 0, reinterpret_cast<void*>(pData));
void ThreadRoute1( void* arg )
{
DataYouWantToPass *pData = reinterpret_cast<DataYouWantToPass*>(arg);
Don't forget to see that the data is deleted when it's no longer needed.
Steve
|
|
|
|
|
hai stephen
thanks for ur reply
but in my problem i have got the directory path in a edit box control variable.
so how can i pass that variable to the thread function
please help me to solve this problem
|
|
|
|
|
hi
wat is type of the member variable? if type of the variable is value then u can directly assign it to the cstring variable of structure and pass it.
eg:
structvar.data=m_FilePath;
|
|
|
|
|
You have to be very careful. He's why:
void ThreadRoute1( void* arg )
{
int *pInt = reinerpret_cast<int*>(arg);
}
{
int v = 1;
_beginthread(ThreadRoute1, 0, reinterpret_cast<int*>(&v));
}
This is a recipe for disaster because for all you know the parent thread can make it to the point where "v" is out of scope before it is accessed in the child thread. This is why I use new in my previous example. He's a reworked version.
void ThreadRoute1( void* arg )
{
int *pInt = reinerpret_cast<int*>(arg);
delete pInt;
}
int *pInt = new int(1);
if ( _beginthread(ThreadRoute1, 0, reinterpret_cast<void*>(pInt)) == -1 )
{
delete pInt;
}
Steve
|
|
|
|
|
Hi all,
I have written the following code snippet to repaint all the child windows. But it not even repaints active child. Where I am wrong?
Thanks in advance,
Sarvan AL
void CMainFrame::OnSettingsChangeFont() <br />
{<br />
CFontDialog dlg ;<br />
if(dlg.DoModal() != IDOK) <br />
return ;<br />
<br />
m_strFontName = dlg.GetFaceName() ;
m_nFontSize = dlg.GetSize() ;<br />
<br />
CMDIChildWnd *pChildWnd = MDIGetActive() ;<br />
CView *pView = pChildWnd->GetActiveView() ;<br />
CDocument *pDoc = pView->GetDocument() ;<br />
pDoc->UpdateAllViews(pView) ;<br />
}
|
|
|
|
|
Hi
Actually do u want to change the fonts in view?
How u r setting the font in OnDraw() function?
|
|
|
|
|
Hi Parthiban,
This is how I am setting the font in my view's OnDraw. If I resize the child window, it gets repainted properly. But I am not able to do on my own.
void CProj5View::OnDraw(CDC* pDC)<br />
{<br />
CProj5Doc* pDoc = GetDocument(); <br />
ASSERT_VALID(pDoc);<br />
<br />
CFont title;<br />
title.CreatePointFont(<br />
((CMainFrame*)AfxGetMainWnd())->m_nFontSize, <br />
((CMainFrame*)AfxGetMainWnd())->m_strFontName, <br />
pDC);<br />
<br />
CFont* oldF=pDC->SelectObject(&title);<br />
...<br />
}
Are you able to conclude anything?
Thanks & Regards,
Sarvan AL
|
|
|
|
|
Hi,
i have a Linear Graph Control,i want to create Mutiple Instance`s of the Control and place them in Same view..The width of the clients Area is same for all the instance , only height will be variable..i need to CRect object as parameter to OnCreate function..what should i do to create mutiple instance same control in a view..with some gape between the Instances
Thanks in before
James
|
|
|
|
|
You mean you want to have the control duplicated (so, exactly the same things will be displayed on both controls) ?
I think you wanted to know how to have two instances of the same control no (it doesn't sound very logical to have the same instance duplicated) ?
If yes, you simply create another variable and create it like the first one. That's it.
|
|
|
|
|
Hi
If u want to use one control to display two or more results on same view or dialog, then place same control twice or thrice on view in design time, declare a variable for each and u can use it.
if u r creating control dynamically, then u can pass the CRect co-ordinates to create function of graph. Most of the graph controls have the option to specify the top left coordinates and right bottom coordinates.
|
|
|
|
|
I have written a MFC application program. Now, I need to create a link between the program to PCI 8255 to printer port. How should i do it and what DLL library should i download?
My hardware consists of sensors to send a signal to PCI 8255, then through parallel port to the software. Then the software will generate a word to be display on the LCD display of my hardware(not my computer monitor). How should I do it?
Help is apprciated..thanks
chris
|
|
|
|