|
Ryan Binns wrote:
What does it return in it gets a WM_CLOSE.
It always returns zero (if the window processes the message). I think Aleon just wants to close the dialog. But if it is a modal dialog box then EndDialog can be used and the result can be passed as a parameter. If not then your answer still remains the best solution (in my opinion).
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Aleon666 wrote:
But neither of them can shut up the dialog.
what's wrong with me?
Simply tell the dialog to shut up and I don't know what could be wrong with you. What kind of symptoms are you experiencing? Just joking.
Seriously, Ryan's last post gives you the correct answer. Where exactly are you calling PostMessage and SendMessage?
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni78 wrote:
Simply tell the dialog to shut up and I don't know what could be wrong with you. What kind of symptoms are you experiencing?
Have you ever thought about doing psychology?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Have you ever thought about doing psychology?
Actually, I am an "engineer" but since I cannot find a job I think I should consider your suggestion. It would be so much fun to play with peoples' minds and tell them that they are crazy when they're just fine.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni78 wrote:
It would be so much fun to play with peoples' minds and tell them that they are crazy when they're just fine.
Remind me never to seek your advice then
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Remind me never to seek your advice then
I think you're crazy!!!;P;P;P
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Thank you all!
I am trying my best to finish this function.
|
|
|
|
|
|
|
I'm glad you understood his question
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
That reminds me... STRONGBAD EMAIL.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Hello,
I have a already built application using MFC. This application uses Context-Sensitive help ( While building they choosen a Context-Sensitive help option for Dialogbased application). The hlp folder of this application contains "afxdlg" rich text document ( this comes by default ).
I want to modify this file to add my own document. But when i modified and recompiled using Help Work Shop the following
error is coming :
C5011: Error: D:\MFC_help\HelpTest\hlp\afxdlg.rtf :
Cannot open the file "{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman."
How can i avoid this and compile with out any error ?
Thank you.
|
|
|
|
|
I have an array in a struct and I am trying to allocate the correct memory size for the data that I need to put in it.
My data is words read from a file.
exp:
deg
active,frozen,stopped
ft/sec
meters
gallon
etc......
If I create a char array can I make each one of those an element of the array?
sj
|
|
|
|
|
127 for char
255 for unsigned char
[EDIT]
You can find this info in limits.h in the include dir of VC++.
[/EDIT]
John
|
|
|
|
|
a char is a single byte so the highest value if cast as an integer would be 255 unsigned or 127 signed.
It sounds like you are actually asking about the max length of a char array. This would be determined either statically by the defining your array like:
// pick a number that is longer than your longest word
#define MAX_WORD_LENGTH 20
// if you know how many words you will conceivably have
#define MAX_WORDS 100
char words[MAX_WORD_LENGTH][MAX_WORDS];
If this definition is made locally - you'll be limited by the size of your stack. If made globally, you'll be limited by your data segment size - or something like that
If you don't know how many words you will have or how long they could possibly be then you'll need to pre parse the file and determine how many words there are and how long the longest one is. Then you could use
char* buffer;
buffer = (char* )malloc(NUM_WORDS*LONGEST_WORD);
I'm going to live forever or die trying!
|
|
|
|
|
If I know a font's name, how I can acquire its character set?
typedef struct tagLOGFONT { // lf
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT;
We know “BYTE lfCharSet;” may set a font’s character set, but I don’t know how acquire it’s all character set?
|
|
|
|
|
Use EnumFontFamilies() (or EnumFontFamiliesEx() ). The ntmCharSet field in the NEWTEXTMETRIC structure passed to your callback function should do the trick
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
May you tell me detailed information? thank you.
|
|
|
|
|
Try this:
int CALLBACK FontProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, int FontType, LPARAM lParam)
{
*(BYTE*)lParam = lpntme->ntmentm.tmCharSet;
return 1;
}
BYTE GetFontCharSet(LPCTSTR lpszFont)
{
CClientDC dc(NULL);
LOGFONT lf;
lf.lfCharSet = DEFAULT_CHARSET;
_tcscpy(lf.lfFaceName, lpszFont);
lf.lfPitchAndFamily = 0;
BYTE bCharSet = DEFAULT_CHARSET;
EnumFontFamiliesEx(dc.m_hDC, &lf, (FONTENUMPROC)FontProc, &bCharSet);
return bCharSet;
} It should work, although I haven't tested it. It basically outlines what you need to do.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am developing a project using .NET Remoting technology to achieve the talk between client and server. The shared object interface in the server is written in C# and compilered into a DLL, which will be used in the client code. So how to access the object in the C# DLL?Here are the source code:
=======IInfoMan.cs->IInfoMan.dll===========
using System;
using System.Runtime.Remoting;
namespace InfoMan
{
///
/// Summary description for IInfoMan.
///
public interface IInformationManager
{
string DataItem(int whichItem);
int DataCollectionLength();
}
}
and Here is the implementation for the interface
=======InformationManager.cs========
using System;
using System.Runtime.Remoting;
namespace InfoMan
{
///
/// Summary description for InfoManager.
///
public class InformationManager: MarshalByRefObject, IInformationManager
{
private string[] theData = new string[ARRAY_SIZE];
private const int ARRAY_SIZE = 3;
public InformationManager()
{
theData[0] = "In a village of LaMancha, ";
theData[1] = "the name of which I have to desire ";
theData[2] = "to call to mind, there lived ";
}
public string DataItem(int whichItem)
{
string theItem = null;
if(whichItem >= 0 && whichItem < ARRAY_SIZE)
{
theItem = theData[whichItem];
}
return theItem;
}
public int DataCollectionLength()
{
return ARRAY_SIZE;
}
}
}
I know that I should use #using keyword to use the C# dll in the Visual C++ code. That is #using "IInfoMan.dll" and also #using <mscorlib.dll>. But when I tried to using the following codes to connect to the server and create a instance of the remote object, I got the error message. Why?
try
{
::RemotingConfiguration::Configure(S"AioTest.exe.config");
InformationManager *m_InfoMan = new InformationManager();//Maybe this line has an error.But I don't know why.
}
catch(Exception * exp)
{
CString msg = exp->Message;
MessageBox(msg);
}
error C3828: 'InfoMan::InformationManager': placement arguments not allowed while creating instances of managed classes
Can someone help me to solve the problem? Thanks!
|
|
|
|
|
the following is my "ftp visit" program:
/////////////////////////////////////////////
//in "stdAfx.h"
#include <wininet.h>
//in CXXXApp::InitInstance()
if(InternetAttemptConnect(0)!=ERROR_SUCCESS)
AfxMessageBox("connect error");
//in application function
HINTERNET hInetSession;
HINTERNET hSecondary;
if(!(hInetSession=InternetOpen(AfxGetAppName(),INTERNET_OPEN_TYPE_PRECONFIG,
NULL,NULL,0)))
{
AfxMessageBox("InterOpen() error");
return;
}
hSecondary=InternetConnect(hInetSession,g_ipAddress,g_FTPPort,
g_account,g_password,INTERNET_SERVICE_FTP,INTERNET_FLAG_PASSIVE,0);
if(!FtpGetFile(hSecondary,remoteFileName,localFileName,FALSE,
FILE_ATTRIBUTE_NORMAL,FTP_TRANSFER_TYPE_ASCII |
INTERNET_FLAG_NO_CACHE_WRITE,0))
{
AfxMessageBox("get ftp file error");
return;
}
////////////////////////////////////////////////////////
error will occur if i choose "using MFC in a shared DLL" in menu "project setting" and build,while no error happen if i choose "using MFC in a static library" and build,why?
the error infomation is as follows:
Bank2.obj : error LNK2001: unresolved external symbol __imp__InternetAttemptConnect@4
D160ABank.obj : error LNK2001: unresolved external symbol __imp__FtpGetFileA@28
D160ABank.obj : error LNK2001: unresolved external symbol __imp__InternetConnectA@32
D160ABank.obj : error LNK2001: unresolved external symbol __imp__InternetOpenA@20
Debug/Bank2.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
the problem is how can i build it successfully in "using MFC in a shared DLL" choice.
be friends
|
|
|
|
|
anyone can help me?
to be or not to be
|
|
|
|
|
Does anyone know of any Natural Language Processing open source for
C++?
at this point in my search, I will take any suggestions, even a link to a free VB source nah forget that. But maybe Java.
I have posted a question to Google answers, and they are trying to find me one too but no answer yet
Hopefully someone here knows of something I could use for the NLP part for Carl v2 I am working on, currently. Thanks.
Later, JoeSox www.humanaiproject.org
"Dream as if you'll live forever; live as if you'll die tomorrow."
- James Dean(ISTP)
|
|
|
|
|
I've got a strong feeling I'm missing the blindingly obvious, but here goes...
I can fire up Internet Explorer from my app and open a url of my choice with the following:
ShellExecute (NULL, "open", urlMap [bReturn].data (), NULL, NULL, SW_MAXIMIZE);
But if I already have a web page open, it is replaced by my URL. This is annoying!
What I want is to start a *new* instance of explorer with my URL. Something like:
ShellExecute (NULL, "open", urlMap [bReturn].data (), NULL, NULL, SW_MAXIMIZE | IE_START_IN_NEW_WINDOW);
Any ideas?
Iain.
|
|
|
|
|
This is controlled by an IE option - reuse existing windows for shortcuts.
I think you can run iexplore.exe -new http://blahblah but then you lose the convenience of automagically using the user's default browser.
--Mike--
"I'm working really, really fast at the moment, so a 3 minute outage becomes, due to time dilation, a 5 minute outage."
-- Chris Maunder, relativistic system administrator
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|