|
You are distributing the debug version of your app. Rebuild it as "MFC Release" and re-distribute it.
Frank
|
|
|
|
|
How do I do that? Lol Im a newbie at it .
orcblood
|
|
|
|
|
Build Menu -> Set Active Configuration -> Click Win32 Release -> ok -> rebuild All.
Frank
|
|
|
|
|
The easiest thing to do is to go to the Project menu and select Settings.... Then go to the General tab and select the Use MFC in a Static Library option.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
It only has Use MFC in a Shared DLL option...
orcblood
|
|
|
|
|
Okay, now it gives me two compiling errors:
AVI PlayerDlg.obj : error LNK2001: unresolved external symbol _MCIWndCreateA
Release/AVI Player.exe : fatal error LNK1120: 1 unresolved externals
Thanks, I know mroe now lol.
orcblood
|
|
|
|
|
You are getting this error because the linker doesnt know where to find the symbol _MCIWndCreateA.
MSDN documentation says that MCIWndCreate function links to vfw32.lib. Try putting that in your linker options as a required library.
Project -> Settings -> Select "Settings for: All Configurations" -> Link Tab
Put "vfw32.lib" in the box for "object library modules". Then rebuild.
Frank
|
|
|
|
|
Oh thank you soo much guys! It works now woohoo! It also works on other people's comps .
orcblood
|
|
|
|
|
orcblood wrote:
It only has Use MFC in a Shared DLL option...
You have the learning edition of VC (or whatever it's called, I forget the exact name) which doesn't let you link statically with MFC. But as you've found out, most folks have mfc42.dll already, so your release version works.
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt - file encryption w/Explorer plugins | 1ClickPicGrabber - web page picture grabber for IE
My IntarWeb Homepgae!!!11
|
|
|
|
|
I want to add my program.exe as a service in windows 2000. Are there any tutorials for doing this either manually or progrmatically.
any help appreciated
George W
Software Developer
www.zsystems.ca
|
|
|
|
|
|
This is the situation:
My computer connects to the internet through gateway software (Wingate) on another computer that is directly connected to the internet. So there is a client application on my computer and a server application on the server computer.
Now the problem is this, i need to make a sort of firewall, but the thing is i cant use a normal firewall because it would just block out the server and i wouldnt be able to do anything anymore (since the connections are routed via the server). The thing i want to do is to filter all the packets that arrive on my computer before they are passed to applications, and even remove them if possible. I have some ideas on how to start but nothing concrete so i would appreciate some advice.
Thanks
Kuniva
--------------------------------------------
|
|
|
|
|
Use WinPcap[^] (Libpcap-based packet capture library for Windows)!
Also Libnet[^] (Libnet is a high-level API (toolkit) allowing the application programmer to construct and inject network packets. It provides a portable and simplified interface for low-level network packet shaping, handling and injection) is suitable.
A. Riazi
|
|
|
|
|
> I mean ,for example ,in the folder of "c:\test"
> there are two files aa.txt and bb.txt .They are
> displayed with the default icon of notebook. If the
> user right click the aa.txt and replaceed the icon
> with a icon file which he like,then the aa.txt file
> display with the icon and the bb.txt display still
> with the default icon of notebook.
> Is it correct ?If so ,I think it's hard and want
> some help.
|
|
|
|
|
I dicide to use ReadFile() rather than fscanf() or fgets() to read a file line by line!
Could anyone tell me again (with an example) how to read, every time i press the same button, a line of a file(something.txt) and then if i press again to read the next line?????? (using ReadFile())
|
|
|
|
|
Dennis L wrote:
I dicide to use ReadFile() rather than fscanf() or fgets() to read a file line by line!
IMHO a bad decision. ReadFile knows nothing about lines, only bytes. Every call to ReadFile goes to the system, forcing context switches for every call, while the std iostream functions perform user-land (in process) buffering.
So not only have you lost the ability to read a text-file line-by-line, you have also made it slower.
For easier and "safer" (in terms of making buffer overflows a thing of the past) access to reading lines from a file, you might want to lookup the C++ function std::getline.
|
|
|
|
|
Thank you for replying me!
I've never used this function before and I don't know how to use it!
By the way the program i'm making is in Win32 API!
How can I use it in here?... Please send an example!!
|
|
|
|
|
Mike Nordell wrote:
Every call to ReadFile goes to the system, forcing context switches for every call, while the std iostream functions perform user-land (in process) buffering.
Everything in the CRT eventually calls APIs to get their job done. fstream , fread() , fgets() et al all boil down to calls to ReadFile() .
--Mike--
PROCRASTINATION: Hard work often pays off after time, but laziness always pays off now.
BUY MY SOFTWARE!! (please?) RightClick-Encrypt - file encryption w/Explorer plugins | 1ClickPicGrabber - web page picture grabber for IE
My IntarWeb Homepgae!!!11
|
|
|
|
|
Michael Dunn wrote:
Everything in the CRT eventually calls APIs to get their job done. fstream, fread(), fgets() et al all boil down to calls to ReadFile().
Yes, but usually not every call forces this context switching by calling ReadFile. If dealing with plain-text and line-by-line input (which was the context here), it seems more than likely that only a very small percentage of iostream calls (to get/read data from the file) would actually result in system calls.
|
|
|
|
|
how can i use a .net dll in a c++ or mfc project?
thanks
|
|
|
|
|
A .NET assembly can be exported as a COM dll, by using the regasm.exe tool provided in the .NET SDK (or tlbexp.exe + regsvr32.exe). Once created and registered, the type library can be used like any other COM object.
[edit]Of course, the COM object itself is only an entry-point to the .NET EE. As a consequence you need to distribute the .NET run-time (dotnetfx.exe) along with your MFC app.[/edit]
|
|
|
|
|
I have the following code which will populate the list control from a recordset.
But it gives error and crashes .
Can anyone rectify the problem.
void CReport::OnGetdispinfoList1(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
// TODO: Add your control notification handler code here
CString szValue = "\0";
CDBVariant varValue;
long index = pDispInfo->item.iItem;
long subItem = pDispInfo->item.iSubItem;
if(pDispInfo->item.mask & LVIF_TEXT)
{
try
{
crs->SetAbsolutePosition(index+1);//Set the file to desired index
}
//<sql>
catch(CDBException* e)
{
AfxMessageBox(message += e->m_strError,MB_ICONEXCLAMATION );
e->Delete();
return;
}
try
{
if(subItem)
crs->GetFieldValue((short)subItem,varValue);
else
crs->GetFieldValue((short)0,varValue);
}
//<sql>
catch(CDBException* e)
{
AfxMessageBox(message += e->m_strError,MB_ICONEXCLAMATION );
e->Delete();
return;
}
const CDBVariant variant =varValue;
try
{
switch(variant.m_dwType)
{
case DBVT_SHORT:{ szValue.Format("%d", variant.m_iVal);
break;
}
case DBVT_LONG:{ szValue.Format("%d", variant.m_lVal);
break;
}
case DBVT_SINGLE:{ if ( variant.m_fltVal == 0.0 )
szValue = "Verify";
else
szValue.Format("%.1f", variant.m_fltVal);
break;
}
case DBVT_DOUBLE:{ if ( variant.m_dblVal == 0.0 )
szValue = "Verify";
else
szValue.Format("%.1f", variant.m_dblVal);
break;
}
case DBVT_DATE:{
szValue.Format("%B %d, %Y",variant.m_pdate );
break;
}
case DBVT_STRING:{ szValue = *variant.m_pstring;//szValue = V_BSTRT( &varValue );//convert BSTR to CString
break;
}
case DBVT_BOOL:{ if(variant.m_boolVal)
szValue = "TRUE";
else
szValue = "FALSE";
break;
}
case DBVT_UCHAR:{ szValue = (char*)variant.m_chVal;
break;
}
case DBVT_NULL:{
szValue = "Error";
break;
}
default:{
szValue = "\0";
break;
}
}//switch
lstrcpyn(pDispInfo->item.pszText, szValue.GetBuffer(szValue.GetLength()), pDispInfo->item.cchTextMax);//set item text
}
catch(CException *e)
{
TCHAR szCause[255];
AfxMessageBox(e->GetErrorMessage(szCause,255),MB_ICONEXCLAMATION );
return;
}
}// End of sorting
*pResult = 0;
}//OnGetdispinfoList1
|
|
|
|
|
How to Play the Images round the Ellipse or Circle?
|
|
|
|
|
hi i wanted to make a linked list in Visual C++ 6.0 , i had done it in c++ but cant do the same in VC. please help me.
i get a run time eror (memory acces error) when i use this code in Visual cpp
typedef struct str
{
int x;
str * next;
}a;
a * node=NULL;
node->x=0; // error occurs in this
|
|
|
|
|
Alright, I was going to respond with a smartass answer, but I won't. First of all, the code you've shown will indeed work if it's running on some special embedded device created by you. However, acessing the address of 0 (NULL) is usually a really bad idea (in usual circumstances, i.e. almost every operating system), and it's why most programmers set pointer addresses to zero when they initialize them: So it will cause a fault when you access an invalid address. So, what you need to do, is allocate your node pointer on the heap. Do this:
a * node = new a;
Don't forget to delete it when you are done with it:
delete a;
Also, since you are using C++, why not use the std::list? It would provide you with all the cool stuff like storage, traversal, etc.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|