|
is it possable to change the name of a .txt file when writing to it? file1.txt file2.txt and so on if so how?
|
|
|
|
|
of course you can, just use sprintf to specify the file name.
like this:
char fname[256];
for (int i=0; i
|
|
|
|
|
"MyDlg" is a dialog class derived from CDialog
"pg_price" is a derived CPropertyPage
on pressing a button pg_price(derived from CPropertyPage), domodal is called
void pg_price::OnBUTTON() <br />
{<br />
MyDlg MyDlg_obj;<br />
MyDlg_obj.DoModal();<br />
}
OnInitDialog of MyDlg (derived from CDialog):
BOOL MyDlg::OnInitDialog() <br />
{<br />
CDialog::OnInitDialog();<br />
return TRUE;
}
now, the problem is that on winxp there isnt any problem. MyDlg_obj.DoModal(); displays the resource of MyDlg
but on win98se, the whole application hangs and become non-responsive upon clicking the button
MyDlg never appeared
so i ran a debugger and found out that the application has no problem running up to "BOOL MyDlg::OnInitDialog()" and returns it without any problem. I hit "f5" again and the application hangs. no assert/buffer overflow problems error messages were given, the whole application simply hangs there. i believe that's because the user interface thread got into something it cant get out of
doing a "step over" on the debugger i got the following
http://img182.imageshack.us/img182/7687/step4em.gif
i really got no idea how this happened
how is it possible that this app works well on winxp but not win98se?
i need that application on win98se platform
using vc++6.0 SP6
win98se/winxp
please assist
|
|
|
|
|
however, on winxp, i get this
http://img34.imageshack.us/img34/9697/winxp0ok.jpg
after some research, i discovered that because the button was located on a CPropertySheet and the domodal is launch from it
this CPropertySheet is one of the pages in the tabs area
this tab area is on my main dialog
anyone have problems doing domodal on CPropertySheet ?
how to solve this problem?
|
|
|
|
|
Just for grins, give your dialog a parent:
void pg_price::OnBUTTON() <br />
{<br />
MyDlg MyDlg_obj(this);<br />
MyDlg_obj.DoModal();<br />
}
and see if that helps.
|
|
|
|
|
I want to export a dialog class from a dll, by using this dialog class, I could create model or modeless dialog in my main project.
Then I need to send messages to mainwnd from the dialog class exported from the already created dll, who can tell me how, or give me some ideas.
Thanks very much.
Best Regards
|
|
|
|
|
Hmm, It seems this question is too hard to answer,
Is it possible to send message to main program's window?
Best Regards
|
|
|
|
|
class __declspec( dllexport ) ... for the DLL
class __declspec( dllimport ) ... for the App.
Further questions?
Don't try it, just do it!
|
|
|
|
|
hi
i made an active x controll that perform the function of rolling dice.
it works fine.now i want to add that on the webpage run on IE. for that purpose i had used the object tag. but my IE does not support that tag.
tell me how can i run my active x through web page.
<title>A Web page with a rolling die
<object id="Dieroll1"
classid="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"
codebase="dieroll.cab#Version=1,0,0,1"
width="200"
height="200">
<param name="ForeColor" value="0" />
<param name="BackColor" value="16777215" />
If you see this text, your browser does not support the OBJECT tag.
Here is some text after the die
tell me how to add active x on web page.
ddd
|
|
|
|
|
Hi,
a user-reported crash minidump reports that the crash happened because EIP was set to 00000000.
Unfortunately, the call stack trace of the bad thread only shows the "00000000()" address in Visual Studio .NET.
Anyone have an idea how I could get more information from the minidump to find out the reason for the crash ?
Thanks,
Manfred
|
|
|
|
|
The dword at the top of the stack can help. It shows you where the call to 00000000 came from.
Don't try it, just do it!
|
|
|
|
|
Sometimes, not always. If the stack pointer was "corrupted" for example by invalid calling convention for example, the function could have returned to this location. The return value could also have been overwritten, so top of stack is a good starting place but you may need to check down the stack to perhaps try to realign the stack to figure out what really happened and if the stack pointer is correct or not and then piece back what happened.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
So, for example the reasons that EIP could be zero (These can also apply to other invalid addresses, however for non-zero invalid addresses there are actually a few more things to look at such as DLLs being unloaded but still on the stack executing).
1. Function Call using a NULL function pointer.
DDS ESP should provide you the return address at the top of the stack of the caller.
2. Invalid calling convention or other mis-operation that would dis-align the stack.
What you could do then is
DDS ESP - xx to dump the stack to find out what the "real" return address was supposed to be. From this you can deduct what the original function call was. Then you can go through that function, find the "RET" and see how many bytes would have been removed. Find the "0" on the stack by deducting this from the current ESP to find out if this is a possible return value match.
Then you can either debug that function, watching the calls and ESP to see where it changes. After each call the ESP should be adjusted to before the parameters on the stack, either immediately upon return or shortly after.
3. Corruption of the stack.
These are a bit tougher. You should dump the stack and attempt to piece together a function call graph using whatever return addresses are still on the stack.
You can check the TEB of the thread to find the top and bottom of the stack so you can also verify if ESP is in the valid range as well. You could then dump the entire stack and find around the area of the problem what return addresses weren't overwritten. Look for data on the stack, for example if you have any arrays hopefully they were strings! If they were you can dump the bytes of the stack and hopefully easily figure out what function had the string that overwrote the return address.
Hopefully one of these methods can help pin point the problem.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
is there anyway to learn which dll files does my program need to run. Or which merge modules to add.
|
|
|
|
|
To see the dependencies of your programs, use the Dependency Walker tool (depends.exe).
To get more info on merge modules and setups in general, try this site:www.installsite.org
Hope this helps
|
|
|
|
|
Hello Everyone,
I am creating a basic WebBrowser type of application.
One of our requirement is to allow drag-drop of images (placed in a layer)
withing the HTML page.
To intercept the dragging events , I overrided OnGetDropTarget() and
provided my own CCustromDropTarget (derived from IDropTarget) class's
object.
Doing so, i am able to receive all the dragging events occuring while user
is dragging image/text etc in the view.
However I am stuck with the following :
1) When the content dragged is an Image (CF_DIB), How do I extract HBITMAP
from the IDataObject passed to DragEnter()
2) Although the content dragged is an image, but thats the represantation of
a particular type of object used in our application.
hence when the image is dragged I want to transfer some more data in this
IDataObject than just the image. Lets say I want to pass actual IHTMLElement
which is being dragged. How Do I achieve that ?
My best guess for the 2nd question was to handle FilterDataObject() and
provide a new IDataObject which has the extra information required in our
application.
Unfortunately this function is never getting called. Can someone please
throw light on FilterDataObject() as well.
Best Regards,
Abhishek Narula
Abhishek Narula
|
|
|
|
|
HRESULT CHtmlCtrl::OnFilterDataObject(IDataObject * pDataObject, IDataObject ** ppDataObject)//filter all except CF_TEXT
{
COleDataObject OleDataObject;
OleDataObject.Attach(pDataObject,FALSE);
COleDataSource* pOleDataSource=new COleDataSource;
if(OleDataObject.IsDataAvailable(CF_TEXT)){
// Get text data from ColeDataObject.
HGLOBAL hGlobal=OleDataObject.GetGlobalData(CF_TEXT);
pOleDataSource->CacheGlobalData(CF_TEXT,hGlobal); }
REFIID riid=IID_IDataObject;
pOleDataSource->ExternalQueryInterface(&riid,(LPVOID*)ppDataObject);
OleDataObject.Detach();
return S_OK;
}
You may get more information if you find the clipboard containes data in CF_HTML or CF_DIB format.
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
First of all, thank you very much for replying to the post.
Let me re-iterate on the question,
In the Very first place, OnFilterDataObject is not getting called. (btw I am using CHTMLView)
Moreover the contents are in CF_DIB format (this i extracted from IDataObject passed in OnDragEnter()) Now my question is how to construct HBITMAP from the data available in CF_DIB format.
Thanks again,
Abhishek Narula
|
|
|
|
|
sorry, FilterDataObject seems only works for copy/paste
try this to prevent the DHTML DOM from handling drag events:
also check if other elements handle these events in scripts. you can either modify these attributes through source code or through DHTML DOM.
you also can override CView::OnDrop to handle dropped data, or CHTMLView::OnGetDropTarget to change the drag/drop behavairs.
for more information about DIB and DDB, check the "copy/paste an image" section of
[^]
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
how to Ensure my program works across platforms? namely, win98se and winxp?
i know one way to do is to simply test them across, but is there a better way?
i work on my program at home using winxp and go down to my office (with win 98se) once a week to test my work
since win98se is an older platform, the stuff i work on winxp might not always work on win98se
some stuff i know:
- when putting in new functions, check the function documentation to see if it works on the platform
- if function doesnt work, try a work around using other functions
does vc++6.0 SP6 have a "check across platform" function in it?
OR if not, is that a program/plugin (preferbly free because i am not paid for my work) that checks whether my code works on win98se and hopefully report the snippets of codes that doesnt work or the extra stuff that needs to be installed before it works? because i dont wanna go down to my office to find that whatever worked at home doesnt work in the office.
intead of doing tests on the exe file.......
i believe that the best way is to have a program that scans the source code for functions that dont work with win98 OR win95 (as specified by the programmer) and report them
is there a program that does this?
|
|
|
|
|
Check MSDN, for every API there is a table on which operating system it will work.
Don't try it, just do it!
|
|
|
|
|
Depending on how long you're working on the project, you could try:
Microsoft Virtual PC 2004 45-Day Free Trial Edition and install Win98 on a virtual machine.
I also thought of Windows Application Compatibility Toolkit, but it doesn't seem to support Win98. I'm wondering if there's an older version of it kicking around somewhere that does.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
dont u guys think that a program that checks the plain text source code (not the exe file) for compatibility is way overdued?
|
|
|
|
|
It's next to impossible to write one, except for trivial programs. I'm sure you'd agree that every non-trivial application uses the CRT or third party libraries, how'll you do source code analysis for those?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
It could be possible and useful; there are many static code analsys tools. In the least they could point out what functions are not supported on which platforms. Some behavior and interactions may not be able to be caught but something is better than nothing. I wouldn't use it as a replacement for testing however it could help to catch as you say "trivial" bugs without having to continously look every function you use up in MSDN or test every system only to recompile to test again.
Have you used Pre-Fast? Have you heard of Poly-Space Verifier?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|