|
I don't follow... am I supposed to type that into the command prompt or something?
Thanks.
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Test your dns server reverse lookups. If your dns server set to return junk, junk is what you will get.
nslookup shows dns responses.
|
|
|
|
|
hello
i am making a simple program in c++ and am using a simple class of my
own called item.
i have created a pointer to this node as follows:
pnode = new node;
and then i check if it has been created properly:
if (pnode)
...
the problem is that checking if it has been created doesnt work -
if i get rid of the defining line, the program still thinks pnode is
a valid object, even though if i debug the program the value of pnode
is "0xcccccccc" which i think means null.
i have tried using if (pnode == null) and other things but i cant get
this simple check to work.
this is only a simple 16 line program with a simple winmain function, so
can anybody tell me what im doing wrong?
thank you
|
|
|
|
|
sorry, the class is named node, not item.
|
|
|
|
|
Berkut wrote:
the value of pnode is "0xcccccccc" which i think means null.
No, a NULL pointer has a value of 0. The /GZ compiler option sets uninitialized variables to 0xCCCCCCCC.
Does the node class have a default constructor? Unless you've done something to it, the new operator calls a class's default constructor.
Berkut wrote:
i have tried using if (pnode == null)
This should actually be if (pnode == NULL), or better still if (NULL == pnode)
|
|
|
|
|
DavidCrow wrote:
This should actually be if (pnode == NULL), or better still if (NULL == pnode)
Interesting. Is there an explanation for that?
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Both (pnode = NULL) and (pnode == NULL) are syntactically correct, but produce entirely different results. By putting the constant on the left of the operator, the compiler guarantees you don't confuse the '=' and '==' operators!
|
|
|
|
|
That makes sense now. Thank you very much.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
When a builtin type (int , pointer, etc.) is used for a stack variable, the variable is not initialized to anything. You cannot assume it will be 0 unless you set it to 0. (NULL is zero, BTW.)
In debug mode, the compiler sets uninitialized variables to 0xCC as a debugging aid - if you see data that's 0xCCCCCCCC and it's supposed to be real data, you know that you forgot to initialize it.
Since you want to test against NULL to check for an initialized pointer, do this:
node* pNode = NULL;
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
I am writing a database program using ADO and Visual C++.
Let me explain my problem.
m_pConn->Open(L"Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=Inventory.mdb;",
L"", L"", adOpenUnspecified );
...
pRs->Open( _variant_t( bstrQuery ),
vNull,
adOpenDynamic,
adLockOptimistic,
adCmdUnknown );
if( m_pRs->Supports( adDelete ) && m_nNoRows > 1 )
{
m_pRs->Delete( adAffectCurrent );
m_pRs->MoveNext();
if( m_pRs->GetADOEOF() )
m_pRs->MovePrevious();
}
CString strFilter = "vField LIKE 'smth%';
m_pRs->Filter = _variant_t( (_bstr_t)strFilter );
//
After I set the filter and I delete a record, if I try to
move to the previous record (even though the record is not
the first) I get an error which suggests that the row where
I am trying to move is either marked for deletion or has
been deleted. Why? The database supports MovePrevious and
I don't use batch mode. This problem occurs only if I
set a filter. The filter works fine too. It selects only
the records that I want it to select.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Hi:
I'm working on a Custom editbox acivex control,my activex have a property called "R2L Readling"(a Check box).when the user set this property the style of editbox will change to "Right to Left Reading order" at Run-Time,i have used the following code to do this:
////////////////////////////////////////////////////////////
ModifyStyleEx(0,WS_EX_RTLREADING|WS_EX_RIGHT|WS_EX_LEFTSCROLLBAR);
InvalidateControl();
////////////////////////////////////////////////////////////
all things work properly but "WS_EX_LEFTSCROLLBAR" doesn't work !!!
in the other hand the left-scrollbar doesn't appear.please help me.
excuse me for bad comments.english isn't my native language.
Best Regards.
|
|
|
|
|
Not all styles can be changed at run-time. You may need to delete and recreate the control. I really have no idea if WS_EX_LEFTSCROLLBAR is one of those or not. Never used it.
Joel Lucsy
|
|
|
|
|
how to make program appear, each time I boot computer, in system tray (like ICQ)?
|
|
|
|
|
One solution is Shell_NotifyIcon().
Kuphryn
|
|
|
|
|
Thanks for answer. Can you explain me in details what is Shell_NotifyIcon() and how use it.
|
|
|
|
|
Creating icon in system tray I can do now. My current problem is to put that icon to system tray, when Windows 2000(for example) starts.
|
|
|
|
|
See the MSDN article Q179365.
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shell_notifyicon.asp
|
|
|
|
|
how to prevent my program appear in task bar?
|
|
|
|
|
Hide the main window. In MFC this will do the trick:
AfxGetMainWnd()->ShowWindow(SW_HIDE)
Of course, you won't be able to interact with the app while it's hidden unless you provide a means of making it visible or allowing it do display a context menu. A common convention here is do add an icon to the system tray while the app is hidden.
Anna
Homepage | My life in tears
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
Trouble with resource IDs? Try the Resource ID Organiser Visual C++ Add-In
|
|
|
|
|
I believe you can take off the WS_EX_APPWINDOW extended style from the window.
|
|
|
|
|
I am not sure if I am doing something wrong, but it doesnt seem to like me using a vector in my managed c++ app.
??
Appreciate your help,
ns
|
|
|
|
|
|
That is exactly what I needed to read...........many many thanks!
Appreciate your help,
ns
|
|
|
|
|
I'm trying to implement a floating window, like a tooltip, to follow the mouse to show display info on our data.
I'm now using the tooltip, and it works ok, not great, but ok; the view gets invalidated, and forces a redraw. ( I was using a simple CWnd before to simulate this, and it was ok also)
Are there other alternatives for that kind of floating window ?
Thanks
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|