|
Use isdigit() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes, use IsDigit(), and you can reference the first character of a CString like a char array (ie mystring[0] )
[A brave person isn't always necessarily a smart person]
bdiamond
|
|
|
|
|
Yep
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Cool!! Didn't know you could access it like an array.
|
|
|
|
|
Does anyone know how to run a C# procedure that is located in a dll from a C++ .net dll?
Thanks
Max
|
|
|
|
|
Hello !
I just started DirectX programming (based on samples I found on several websites). In fact I want to make a game (so in fullscreen mode). Everything is ok for that part but the problem when using this exclusive & fullscreen mode is that you cannot debug anymore (the screen remains black when a break point is reached in your code).
So I wanted to first start by using a windowed game for debugging purpose. But there the problem is when I try to create the front buffer using CreateSurface (with CooperativeLevel flags set to DDSCL_NORMAL):
DDSURFACEDESC2 ddsd;<br />
ZeroMemory( &ddsd, sizeof( ddsd ) );<br />
<br />
ddsd.dwSize = sizeof( ddsd );<br />
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;<br />
<br />
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |<br />
DDSCAPS_FLIP |<br />
DDSCAPS_COMPLEX;<br />
<br />
ddsd.dwBackBufferCount = 1;<br />
<br />
hRet = m_pDirectDraw->CreateSurface(&ddsd, &m_pFrontBuffer, NULL );
The function returns DDERR_NOEXCLUSIVEMODE ...
How can I solve the problem ??
|
|
|
|
|
I recall having that same problem before about breakpoints in fullscreen mode. I think you can alt+tab or something like that to get back to the development environment.
[A brave person isn't always necessarily a smart person]
bdiamond
|
|
|
|
|
No, in fact what happens is that when I reached a breakpoint, I can see the taskbar but the rest of the screen is still black (wathever I do, also using alt+tab...). This is quite annoying
|
|
|
|
|
You may want to invest in a second monitor. You can then run the IDE on the second monitor and debug your DirectX application on the first monitor.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Mhh, yes that could be a solution but this project is just for spare time and so, I don't want to buy a second monitor just for that...
Isn't it possible to debug DirectX applications ????
|
|
|
|
|
cedric moonen wrote:
Isn't it possible to debug DirectX applications ????
I have had the same trouble debugging a fullscreen DX application with a single monitor. I don't think there is an easy way round this given a single monitor setup and the standard IDE.
There is a debugging tool called SoftIce. We use it at work to debug drivers and shared memory between applications. SoftIce has the advantage of freezing the applications and switching to its own debug screen (text driven screen). This would allow you to debug DX applications quite easily.
http://www.compuware.com/products/driverstudio/softice.htm[^]
Not sure on the cost of this though!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Ok thanks, I will take a look at it
|
|
|
|
|
I have been working with directx for a long time (like 7 years) and the best way to debug an application is to use the remote debugging (debug via a second pc) feature of visual studio. Local debugging will only cause you problems as you can not flip the screen to the windows GUI to break your code.
John
|
|
|
|
|
hello..
is there an API function or something to enumerate remote computers names on a LAN??
|
|
|
|
|
I think you are looking for NetServerEnum() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello All,
I am trying to memory mappin technique to parse zone file. The program is running fine for small file of size around 350MB but the same program failes when the file size becomes 2.5GB
Here is a simple program which works fine for small files but fails for large files:
#include <windows.h><br />
#include<stdio.h><br />
<br />
<br />
<br />
int main(void)<br />
{<br />
<br />
char * p1stData;<br />
HANDLE hMap1stFile; <br />
HANDLE h1stFile; <br />
LPVOID lp1stMapAddress; <br />
h1stFile = CreateFile("biz.zone", GENERIC_READ | GENERIC_WRITE, 0, NULL,<br />
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br />
if (h1stFile == INVALID_HANDLE_VALUE)<br />
{<br />
printf("h1stFile is NULL\n");<br />
printf("Target file is %s\n", "biz.zone");<br />
return 4;<br />
}<br />
hMap1stFile = CreateFileMapping( h1stFile,
NULL,
PAGE_READWRITE,
0,
0,
NULL);
<br />
if (hMap1stFile == NULL) <br />
{<br />
printf("hMap1stFile is NULL: last error: %d\n", GetLastError() );<br />
return (2);<br />
}<br />
lp1stMapAddress = MapViewOfFile(hMap1stFile,
FILE_MAP_ALL_ACCESS,
0,
0,
0);
if (lp1stMapAddress == NULL) <br />
{<br />
printf("lp1stMapAddress is NULL: last error: %d\n", GetLastError());<br />
return 3;<br />
}<br />
<br />
<br />
p1stData = (char *) lp1stMapAddress;
<br />
<br />
for(int i=0;i<1000;i++)<br />
{<br />
printf("%c",*p1stData);<br />
}<br />
return 0;<br />
}
The error that comes is:
hMap1stFile is NULL: last error: 1006
Is there any upper limit on the file size which can be memory mapped.
dotcom
|
|
|
|
|
krabhinav wrote:
Is there any upper limit on the file size which can be memory mapped.
I would think so, especially if memory allocation is involved. Remember that asking for 2.5GB of RAM means that 2.5GB of contiguous RAM must exist or the allocation fails. That aside, error 1006 says that the volume for a file has been externally altered so that the opened file is no longer valid.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi
Can I add a accelerator key to Button and Toolbar. When the user presses any Alt+Key, the button and toolbar button functions must be invoked just as in case of a menu.
Can any one please suggest any solution to this
Thanks
Madhavi
|
|
|
|
|
Hi,
I do hope that you'll be using sdi/mdi appln. so in the Accelerator resource named IDR_MAINFRAME, add a new entry with the name of the control say IDC_BUTTON_TEST and assign the key stroke to it. It will call the handler.
SUjan
|
|
|
|
|
Hi,
Yes I am able to add accelerator keys using Accelerator tabel to individual buttons. But I have one problem. I'm unable to display the underscore symbol beneath the letter in the caption for Buttons(Toolbar buttons) for the user to know that accelerator key is present.
Madhavi
|
|
|
|
|
Hai frens.. .
I have created a modeless dialog. . .I am creating the modeless dialog with their parent as desktop, in order to send dialog behind the parent window once the parent is clicked. Now i have a prblm that once the modeless dialog is closed the parent is not getting activated. . Only if i click on it its getting active.Could any one help me to over come this prblm. .
Tanx
bye
|
|
|
|
|
Hi,
you can use the function SetForegroundWindow() using the window address to make it active
Sujan
|
|
|
|
|
I tried using that fnction its not working. . .
my application is an form based SDI.
I tried to bring parent to fore ground on the close of child.
but its not working.
Do any boby have some other solution.
Tanx
bye
|
|
|
|
|
here is a code snippet I found on this site a few weeks ago. I think the title of the article is something like "Dialog box tips & tricks". I haven't tried it yet, but I thought it may come in handy, so I put it in my Code Librarian:
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),TRUE);
SetForegroundWindow();
SetFocus();
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),FALSE);
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
bdiamond
|
|
|
|
|
Hi!
I'm currently programming some tool that installs a process (automatically running at startup as admin), which accepts incoming network TCP connections, processes some data and returns something. Think of something like a FTP or web server. I'm using Windows 2000.
Now I got a problem: while I'm logged on, the tool works perfectly, everything runs fine. The server accepts all clients and returns the correct data. But when I log off, Win2k doesn't accept incoming connections any more...
It's not the process what isn't working, the process remains perfectly in the background and isn't killed or stopped. It's just that Windows 2000 seems to block incoming connections while nobody is logged on... As soon as somebody is logged on, the server gets the incoming connections again...
Any way to tell Win2k to accept incoming connections while nobody is logged on?? Maybe we can even define the port?? Or maybe I must call something from my program?
Thanks and best regards
|
|
|
|