|
It is in the codeproject.
Just try to search for "single instance"
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Does anybody know if there is a maximum interface card count defined in windows?
What about a maximum IP address count per interface?
Thanks
|
|
|
|
|
Don't know about max cards per system, but Windows only allows one IP per interface.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
Windows does allow multiple IPs per card. Go to your TCP/IP Properties for the ethernet card in question, click on the Advanced button. On the IP Settings tab you should the currently listed IP addresses for the interface. In your case, you should probably only see one. You can click on the Add... to add additonal IP addreses.
|
|
|
|
|
Hi,
I created a class from CFrameWnd that has a CListView as a view.
I created these kinds before but now I have a starnge problem
If I pop up this window and close it, everything is fine. But as soon as I even click inside the window and then close it, I get an exeption and the debugger throws me here:
<br />
CView* CFrameWnd::GetActiveView() const<br />
{<br />
ASSERT(m_pViewActive == NULL ||<br />
m_pViewActive->IsKindOf(RUNTIME_CLASS(CView)));<br />
return m_pViewActive;<br />
}
What is the problem ?
|
|
|
|
|
You could use ASSERT(::IsWindow(m_pViewAvtice) to see if the HWND is available. You could be probably deallocate the HWND somewhere
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I'm trying to use DirectX v9.0 to draw stippled lines. I use the ID3DXLine interface. For the most part it works. However, I can't get stippled (pattern) lines to render correctly. The pattern does not appear to render correctly. It seems like it only renders correctly if the line is drawn vertically. Any help would be greatly appreciated.
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
I'll have to check my DX 9.0 book tonight, I only have my 8.1 with me now and it doesn't mention ID3DXLine at all, to give you a technical answer, supposing I can find it. A few things to check on in the mean time: update your DX runtime, 9.0b just came out a little while ago, it could be this, but I'm thinking unlikey. Also update your graphics drivers. I had difficulties rendering minor polys until I figured I needed to up my Detonators. BTW if you have an ATI card, don't forget to uninstall all drivers for it thru your control panel before you install the new ones, you get major problems otherwise. One final thought: diagonal lines can be hard to notice any patterns on them since the pixels only touch around the corners for the most part. Do you get this problem when drawing horizontal lines as well? Give me a code snippet to work with and I'll see what I can dig up.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
Thanks for the reply. I am using v9.0. I'm also going to update the drivers. As for horizontal lines, it sometimes fails there also.
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
One other thing. After updating the graphics drivers, reinstall DX 9.0b over the top of that to make sure everything's talking nicely.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
Tough thing. I can't find mention of it in my DX9 book. Whoa. I did look it up on MSDN and actually understood most of it. If you could show some code that you're using, I might be able to come up with something. If the pattern is not being rendered on the line, do you have some control path where SetPattern() is not being called? Another thing is if your video card supports this function in hardware. I've a Radeon 9000 that supports a lot of DX9 in hardware, but not all, especially when it comes to transparency effects, namely cloaking in Halo. It could have something to do with that.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
There were a number of problems with ID3DXLine in the initial release of the DirectX 9.0 SDK which were supposedly fixed in the DX9 Summer Update SDK, which made a large number of fixes and improvements to D3DX. Try updating your copy of the SDK if you haven't updated already.
ID3DXLine simply draws lines via very-thin quads (similar to what many drivers do internally for older cards which don't support drawing lines), so it shouldn't be a driver problem, but you never know
- Mike
|
|
|
|
|
Thanks to both of you for your replies.
I'm currently using the 9.0b (4.09.0000.0902) SDK. I assumed this was the most current. It appears now it might not be. As for a code snippet, the following is the "guts" of the routine that renders the lines:
================================
void draw_line_strip_dx(int numpts, p_3d pts[], MC_BYTE color)
{
D3DXMATRIX worldMatrix;
D3DXMATRIX viewMatrix;
D3DXMATRIX projectionMatrix;
D3DXMATRIX resultMatrix;
D3DXVECTOR3* pVertices=NULL;
BYTE r = GetRValue(Wd_colors[color]);
BYTE g = GetGValue(Wd_colors[color]);
BYTE b = GetBValue(Wd_colors[color]);
D3DCOLOR vcolor = D3DCOLOR_XRGB(r,g,b);
pVertices = new D3DXVECTOR3[numpts];
for (int n=0; n<numpts; ++n)
="" {
="" pvertices[n].x="pts[n][X];
" pvertices[n].y="pts[n][Y];
" pvertices[n].z="pts[n][Z];
" }
="" get="" world,="" view="" and="" projection="" matrices.
="" pdirect3ddevice-="">GetTransform(D3DTS_WORLD, &worldMatrix);
pDirect3DDevice->GetTransform(D3DTS_VIEW, &viewMatrix);
pDirect3DDevice->GetTransform(D3DTS_PROJECTION, &projectionMatrix);
// create a transform: world * view * projection.
D3DXMatrixIdentity(&resultMatrix);
D3DXMatrixMultiply(&resultMatrix, &worldMatrix, &viewMatrix);
D3DXMatrixMultiply(&resultMatrix, &resultMatrix, &projectionMatrix);
// render line strip.
pDirect3DDevice->BeginScene();
pDirect3DLine->Begin();
pDirect3DLine->DrawTransform(pVertices, numpts, &resultMatrix, vcolor);
pDirect3DLine->End();
pDirect3DDevice->EndScene();
// clean up.
delete pVertices;
}
================================
I've also updated my drivers. It did not help. I'm going to take a look at updating to the "Summer SDK".
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
I have resolved this problem by installing the latest SDK and adding some code. I'm not totally convinced that the updated SDK helped, but with the added code, the problem no longer exists. I added calls to SetGLLines() and SetPatternScale() to define the line stipple.
Gort...Klaatu, Barada Nikto!
|
|
|
|
|
Hello,
the thing is still Outlook Automation.
After I could create an new Item just as an subfolder in the Inbox I
need to store some messages in this "NewFolder".
Therfore I need a reference to this folder - but how can I get it ?
In the VB Documentation I can see a function calls
GetItemFromID(LPCTSTR EntryIDItem, const VARIANT& EntryIDStore)
The Problem by using this is the second value.
I don´t know what to do !
Is there anyone in this Forum who can give me a subtle hint in what I have to do.
I little bit code and some encouraging words would be wonderful !
The MSDN is full of VB and VBA Code; but there are only few examples for C++.
Thanks a lot,
John
|
|
|
|
|
So how comes this line VC6 actually works?
char szString[21];
cout << "Please enter a string : ";
cin.getline(szString, 25);
But if I change the 25 to 26, it crashes?
I would have thought anything beyond 21 would make it crash actually, but to my surprise you can actually increase it all the way to 25 without crashing anything.
Any ideas?
|
|
|
|
|
anonymous wrote:
So how comes this line VC6 actually works?
<br />
char szString[21];<br />
cout << "Please enter a string : ";<br />
cin.getline(szString, 25);
anonymous wrote:
I would have thought anything beyond 21 would make it crash actually, but to my surprise you can actually increase it all the way to 25 without crashing anything.
char szString[26];
<br />
Alton
|
|
|
|
|
I think you didn't get my question.
Eventhough my szString can only hold 21 characters tops, I can read in as many as 25 characters into it without crashing which I thought was a bit of surprise. I was under impression anything greater thant 22 would have crashed it,but it didn't..22,23,24 and even 25 worked just fine.
take care
|
|
|
|
|
You are being lucky, the buffer is being overrun touching other parts of the stack, though by mere coincidence the app is not crashing. Try this:
int before=0;
char szString[21];
int after=0;
cout << "Please enter a string : ";
cin.getline(szString, 25); Most likely you'll see the contents of either before or after are being changed after reading the string, which certainly can crash the program in more complex scenarios.
Do not expect crash in every situation crash might occur. Things can get worse and such a problem can go unnoticed until least expected.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Personally I'm not sure why you're purposely writing past an array, unless you're wanting to play Russian Roulette with your system. Nah, I don't think it'd be that bad, but still...
My guess is that the char array is usually made in the same block of memory every time you ran the program, assuming you didn't reboot or run any other app between your "testing" runs. This way you're writing past the end into the same chunks of memory and they were probably empty. The time you crashed it probably wrote too far and overwrote some other chunk that was slightly necessary to your system. Or I could be totally wrong, wouldn't be the first time. But also don't forget that getline has a third parameter for a delimination chararcter to look for. If you're allowing it to go 26 char 's long but only entering 19 into the istream it will see that '\n' and stop. Also, your 21 char array really should only hold a string 20 char 's long, you need the last element for '\0'.
The question "Do computers think?" is the same as "Can submarines swim?"
DragonFire Software
Jeryth
|
|
|
|
|
I am not sure this is the best place to put this thread so I apologize ahead of time if it should have been posted in the embedded section.
I have an application that I would like to port over to VC++. What is the easiest way to port the project and does anyone have any tips that I can use?
I have not used any specific methods or API that are found only in wince, but I would like to be able to have only one code base for ease of future development. Also it would be nice to be able to take advantage of the increase in screen real estate on the desktop that I didn't have on the ppc. Everything in the ppc applciation was coded using unicode also.
Thanks for the help,
-Eric
|
|
|
|
|
Hello,
the thing is still Outlook Automation.
After I could create an new Item just as an subfolder in the Inbox I
need to store some messages in this "NewFolder".
Therfore I need a reference to this folder - but how can I get it ?
In the VB Documentation I can see a function calls
GetItemFromID(LPCTSTR EntryIDItem, const VARIANT& EntryIDStore)
The Problem by using this is the second value.
I don´t know what to do !
Is there anyone in this Forum who can give me a subtle hint in what I have to do.
I little bit code and some encouraging words would be wonderful !
The MSDN is full of VB and VBA Code; but there are only few examples for C++.
Thanks a lot,
John
|
|
|
|
|
Hi guys
What I have to do to change the default file name in Save Dialog in an SDI app?
Best Regards
Doc
|
|
|
|
|
First override the OnFileSave (and OnFileSaveAs if you want to) menu handlers, then just set the name of the default file that you want into the following variable;-
m_strPathName = _T("Whatever");
m_StrPathName is used by the CDocument save functions to work out what file name is presented to the user. If the m_strPathName is empty then the name of the document is used as a basis for the file name. So alternatively you can just call
SetTitle(_T("Whatever"));
instead, although this will not necessarily put the extension you would like onto the document by default, if you have more than one anyway.
Hope this helps,
Mark
|
|
|
|
|
I have a cDialog class that I spawn with new MyClass in another class (MainClass), and I push_back this m_pMyClass pointer on a vector. Now from another location I wanted to delete and zero out the pointer and I tried:
delete myGlobalVector[i];
myGlobalVector[i]= 0;
This didnt seem to do it.
So then I did,
delete MainClass.m_pMyClass;
MainClass.m_pMyClass = 0;
and this worked.
I am puzzled. I thought the first approach would work too..............??
Thanks,
ns
|
|
|
|