|
Thanks for answering...
Yes, I think.
I started NameService as follows:
"C:\omni\bin\x86_win32\omniNames.exe -start 12345 -logdir C:\omni -errlog C:\omni\errlog"
It seems I have initialized my NameService at port 12345
I have created my NameService.bat on it and It seems to work. I runs.
The problem is when I run my Server.
Is there anything more I have to do?
.
|
|
|
|
|
Yes, the following things should always be done (with every code you write)
<list> Write code that handles errors where errors can be expected (you did this)
If you find an error don't just print "ERROR" Print as much information as you can. This information often is found in the caugth exception, or can be obtained through some api's
Without that information, many things could be happening. Maybe you run a firewall that blocks your namingserver, etc...
Blog[^]
|
|
|
|
|
Hi everyone,
in your resources you can set resources for different language. The appropriate language is loaded according to you windows language. Therefor in your resource file you have to add e.g. '#if defined(AFX_TARG_NLB)' for you dutch resources.
Now, I have a database containing a field with strings in dutch in it and a field with its english translations. If the dutch resources are loaded I want to take the dutch field. I no dutch resources are loaded I want to take the english field.
Therefor I want to do this in my cpp file:
#if defined(AFX_TARG_NLB)<br />
m_iLanguage = Dutch;<br />
#else<br />
m_iLanguage = English;<br />
#endif
And use the m_iLanguage variable in my database query for fetching the right language.
I guess AFX_TARG_NLB is defined if the windows version has dutch language, AFX_TARG_ENG when windows has english language. These macros seem to be only defined in .rc files.
So the problem is: the AFX_TARG_... are not defined in my cpp files. How comes and does someone know how to solve it?
µAnother thing, does someone has a solution for this: http://www.codeproject.com/script/comments/forums.asp?forumid=1647&XtraIDs=1647&searchkw=afx_targ_enu&sd=2%2F26%2F2001&ed=5%2F27%2F2005&select=463413&df=100&fr=92935.5#xx463413xx[^]
thx
|
|
|
|
|
I’m about to insert a Win32 window in a CWnd (or more specific an COleControl). I’m an old MFC-coder and not really good att Win32 API. After what I understand I should take care of the HWND instance of CWnd…
How do I make the sole Win32 window to stretch over my CWnd… ?
Thanks in advance…
_____________________________
...and justice for all
APe
|
|
|
|
|
I'm having a problem with the CreateControl method of the CWnd object.
I can create the ActiveX but it seems that the Ctrl-c and Ctrl-v is not forwarded to the Active X but all the general key press works.
When i insert the ActiveX in the OLE test container the Ctrl-c and Ctrl-v works fine.
Please help me.
Thanks
|
|
|
|
|
Johan Odin wrote:
I can create the ActiveX but it seems that the Ctrl-c and Ctrl-v is not forwarded to the Active X but all the general key press works.
Have you got an accelerator table loaded which has those combinations as a shortcut? If so, you'll have to disable it or remove the combinations you want the control to handle.
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"
|
|
|
|
|
A very big thanks to you Ryan, now it works!
|
|
|
|
|
no no, i'm not spaming the forum...
i have the following code :
BOOL CMSILauncherDlg::OnEraseBkgnd(CDC* pDC) {
<font color=green>
CBitmap BackGroundBitmap;
BackGroundBitmap.LoadBitmap(IDB_BGND);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
MemDC.SelectObject(&BackGroundBitmap);
CRect ClientRect;
GetClientRect(&ClientRect);
CPoint OriginPoint(0, 0);
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
BackGroundBitmap.GetBitmapDimensions().cy);
<font color=blue>for</font> (OriginPoint.y = ClientRect.top; OriginPoint.y < ClientRect.bottom; OriginPoint.y += BGBitmapSize.cy) {
<font color=blue>for</font> (OriginPoint.x = ClientRect.left; OriginPoint.x < ClientRect.right; OriginPoint.x += BGBitmapSize.x) {
pDC->BitBlt(OriginPoint.x,
OriginPoint.y,
BGBitmapSize.cx,
BGBitmapSize.cy,
&MemDC,
0,
0,
SRCCOPY);
}
}
<font color=blue>return</font> 1;
}
the above code doesnt work till the BackGroundBitmap.GetBitmapDimensions() return {0, 0} as size...
if i manually replace the function calls by the actual bitmap size, the function work quite fine (in fact, the bitmaps are not well "mosaic-ed" but spaced - maybe a unit problem).
<font color=green>
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
BackGroundBitmap.GetBitmapDimensions().cy);
<font color=green>
CSize BGBitmapSize(190, 187);
<font color=green>
BackGroundBitmap.SetBitmapDimensions(190, 187);
CSize BGBitmapSize(BackGroundBitmap.GetBitmapDimensions().cx,
BackGroundBitmap.GetBitmapDimensions().cy);
does anyone already encountered this problem ?
any suggestions or solutions ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Use CBitmap::GetBitmap to fill a BITMAP structure. Use BITMAP::bmWidth and BITMAP::bmHeight for the size of the bitmap in pixels.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
PJ Arends wrote:
...for the size of the bitmap in pixels.
from the MSDN, they say for CDC::BitBlt :
Parameters
x
Specifies the logical x-coordinate of the upper-left corner of the destination rectangle.
y
Specifies the logical y-coordinate of the upper-left corner of the destination rectangle.
what is called a logical coordinate ? pixels ? or dbu ?
are there any functions to convert pxl <---> dbu ??
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
logical coords are never dbu. What they are depends on the mapping mode of the DC. See CDC::SetMapMode(). If you do not explicitly set the map mode to something else it will be MM_TEXT and logical coords will be pixels.
Use MapDialogRect() or GetDialogBaseUnits() to convert between pixels and dbu, although I have no idea why you would have to just for displaying a bitmapped background. GetClientRect() will give you the dimensions of your window in pixels.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
An alternate method to tiling a bitmap over a window is to use CreatePatternBrush [^] to create a brush, and then use FillRect [^] to fill the window. This approach automatically takes into account the size of the bitmap, the window, and so on.
Software Zen: delete this;
|
|
|
|
|
but i don't want to fill, i want to mosaic my bitmap...
thanks anyway for your answer
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
good morning everybody,
As some of you might have sees yesterday, I have some trouble with reactivating an already existing instance of a program of my own which lost the focus.
Mr DavidCrow suggested me to use EnumWindows() , but as i am not familiar at all with CallBack functions, i'd be grateful if some of you post a little example of use of the this functions.
the best would show how to get the handle of a particuliar windows...
thank to all of you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
toxcct wrote:
use EnumWindows(), but as i am not familiar at all with CallBack functions,
With CallBack, You can also use FindWindow and FindWindowEx to Enumerate all Visible desktop Window.
here little Piece of Code to do that:-
BOOL NMPEnumWindows(CStringArray *arWindowsName,CPtrArray *arhWnd)
{
HWND hWnd,hWnd1=NULL;
CString Str;
char lpString[201];
hWnd=::GetDesktopWindow();
do
{
hWnd1=::FindWindowEx(hWnd,hWnd1,NULL,NULL);
::GetWindowText(hWnd1,lpString,200);
Str.Format(\"%s\",lpString);
//select only visible desktop window
If((::IsWindowVisible(hWnd1)==TRUE)&&(Str!=\"\"))
{
arhWnd->Add((HWND)hWnd1);
arWindowsName->Add(Str);
}
}while(hWnd1!=NULL);
return TRUE;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I need help for two questions , the subject defines the first one.
1)
I created a static splitter window with two horizontal panes. When i click on a particular pane that one becomes active and the other one inactive, which is obvious. But my application requires that only the second one should be active forever. Even if i click on the first pane the control should again return back to the second pane. This may contradict the very idea of using a splitter window, but there seems to be no other option. Can anyone please help?
2)
I use the splitter window so that i can display text in the first pane and display bitmaps (on which i perform image processing operations) in the second pane. Once the text is displayed in the first pane i want it to remain there forever(as long as the application runs). All the operations are to be performed in the second pane without disturbing the first pane.
If anyone can suggest a better way than using splitter windows please let me know.
Thank You
|
|
|
|
|
How to store an HTML page with the use of serialize function of the document class in and SDI applicaition? Any code for that?
|
|
|
|
|
Whenever I do a build, say a Release build, the wrong referenced assemblies (the Debug versions instead of the Release versions) get copied to the target directory. In fact, the Debug versions of the DLLs will get copied to the target directory in both Release and Debug configurations - usually. I can get Visual Studio to reverse this behavior by removing the DLL project refrences and re-adding them while in Release build configuration. Now the Release versions of the dll assemblies will be copied to the target directories during both Release and Debug builds. Does anyone have any idea what is going on here???
Note that, in spite of this weird behavior, when I view the properties for a particular assembly referenced in any given project, the file location is always correct; that is, it will be in the /Debug folder in Debug configuration and in the \Release folder in Release configuration.
|
|
|
|
|
if you want it to overwrite the old link version every time you run a new compile?
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
Don't know exactly what you mean, but link incrementally off?
|
|
|
|
|
What's the use of that. The compiler will pruduce the same object files for the files that havn't changed. If you change some code the old linke executable will become overwritten automatically!
Blog[^]
|
|
|
|
|
I failed to mention that you have a window remained opened from the previous executable.
William
Fortes in fide et opere!
|
|
|
|
|
If you want to build another executable, you have to close the application (the executable itself if its running). If you really don't want that, than you have to change the compiler / linker output path to a different directory.
Hope this helps
Blog[^]
|
|
|
|
|
I've been programming command window C++ programs for quite a while now. I've gotten my feet wet with both MFC and direct API calls for Windows application programming, but I'm not sure which is better. MFC seems easier to get the interface going, but I'm not sure how to interface all the different controls/buttons etc. The API calls seem like they don't let you do everything that you can do with MFC, but they seem more documented in MSDN. Anyways, which way should I go for professional application development. I don't want to learn something that will be useless when I get a programming job after college.
Thanks!
|
|
|
|