Click here to Skip to main content
13,625,905 members

Comments by ilostmyid2 (Top 200 by date)

ilostmyid2 3hrs 10mins ago View
   
I need to solve the problem not by using any means, just softwarely.
ilostmyid2 9-Jun-18 10:48am View
   
i expect it anyway... :)
ilostmyid2 9-Jun-18 10:41am View
   
thx, looked for this.
after implode, i may call the function again:
error_reporting(E_ALL);
so that other errors won't be suppressed.
but essentially why this should have been an error?!...
ilostmyid2 9-Jun-18 10:36am View
   
the line below it:
0, Array, 1
ilostmyid2 9-Jun-18 10:35am View
   
oh thanks. I did. this is the result:
NOTICE Array to string conversion on line number 5
ilostmyid2 9-Jun-18 10:10am View
   
Deleted
because i was speaking about just a function of php
ilostmyid2 9-Jun-18 10:09am View
   
so maybe something is different in php config file(s)?
ilostmyid2 9-Jun-18 9:34am View
   
sorry, i thought it was clear enough. now i've updated it with an example.
ilostmyid2 9-Jun-18 8:53am View
   
I see that you didn't get the architecture. Please re-read what I wrote. Id of a row in MonitorGroups table is a reference for a row in Monitors table. For example, if we want to know what monitors are defined in a specified group we run this query:
SELECT * FROM Monitors WHERE GroupId=<id>;
ilostmyid2 9-Jun-18 8:46am View
   
no help. existence of a row in table MonitorGroups with Id 0 is inevitable for creating the foreign key.
ilostmyid2 21-May-18 5:31am View
   
the question is exactly this, what causes the date-time not to be synced?
ilostmyid2 26-Apr-18 10:18am View
   
no, it's an array which is returned and i don't change it nor fill another collection or array based on it. i just use it as it's returned. I'll try BindingList for this purpose. thanx. I know few about it, but I hope I'll succeed.
ilostmyid2 26-Apr-18 10:01am View
   
we're programming in C# winforms, web services are accessed via NuSoap in Linux. the return value of web service is a simple structure.
ilostmyid2 26-Apr-18 8:30am View
   
thank you. is there any way other than using BindingList? indeed the data source comes from a web service hosting on linux. can't make it return a BindingList.
ilostmyid2 26-Apr-18 8:29am View
   
it's indeed a RadListView control
ilostmyid2 26-Apr-18 6:59am View
   
it's my own account at dropbox, but ok, where do you want to be uploaded?
ilostmyid2 25-Feb-18 11:11am View
   
indeed i need authentication, but not to define a separate user/pass than the defined user for the linux system itself. i mean how to avoid separation and have not to define separate users for samba?
ilostmyid2 1-Jan-18 14:15pm View
   
now what can i do to introduce network as a trusted source?
MS better not to make barriers than making the world a safer place!
ilostmyid2 1-Jan-18 14:13pm View
   
I didn't think this may be the cause. A drive is a drive. If it's trusted enough to run/debug a program, it should be trusted to access the PDB file for this purpose!
ilostmyid2 1-Jan-18 13:17pm View
   
omg! i copied the whole solution from network drive into a local drive and the problem was resolved! why? the drive is essentially provided by SFTP Net Drive which is mapped from a linux machine. maybe i've to change the settings of Windows/SFTP Net Drive? maybe the problem would happen even if the network drive would be a mapped drive from a Windows share?
ilostmyid2 1-Jan-18 11:53am View
   
they're not absolute paths. so include no drive letter. they're relative paths.
ilostmyid2 26-Dec-17 13:25pm View
   
the directories hierarchy is the same. i did a clean and rebuild with no success.
ilostmyid2 26-Dec-17 11:31am View
   
as i told before, the warning is:
The breakpoint will not currently be hit. No symbols have been loaded for this document.
now what can i do? i see the PDB files there.
ilostmyid2 26-Dec-17 10:59am View
   
build mode is Debug. i use F5. i'm not going to step into assemblies. the line with the breakpoint is located in my own code.
ilostmyid2 26-Dec-17 10:52am View
   
The breakpoint will not currently be hit. No symbols have been loaded for this document.
ilostmyid2 13-Nov-17 6:26am View
   
thank you. i read the document and didn't find any clue about how to call the web service ASYNCHRONOUSLY. calling web services is what we're currently doing. but all of them are synchronous calls.
ilostmyid2 10-Oct-17 7:09am View
   
yes. i told it was clear.
ilostmyid2 8-Oct-17 13:15pm View
   
1. many programs are written with void main(void) which do many things!
2. the question is clear. i described in glimpse.
ilostmyid2 27-Jul-17 12:05pm View
   
ur right, but since programmers write extension modules for apache, i thought it would be a good idea to ask my question here. if you know a more proper site, i would glad if u give me the link.
ilostmyid2 27-Jul-17 11:36am View
   
it can't solve the problem. considering i want to see errors and don't want to see output, this command redirects stderr to stdout. apxs2 writes its output as well as errors to stderr. so i'll get both on stdout. what differ?!
ilostmyid2 1-Jul-17 6:43am View
   
thank u
ilostmyid2 1-Jul-17 6:43am View
   
thank u. it's better that i read and learn more about sql script language.
ilostmyid2 29-Jun-17 8:39am View
   
how?
ilostmyid2 21-Jun-17 21:49pm View
   
oh ic
thx
is there any way not to allow invalid values entered manually? ie. without using spin control.
ilostmyid2 21-Jun-17 12:04pm View
   
thanks for the code. i wonder why my code didn't work:

dateTimePicker1.Value.AddMinutes(29);
ilostmyid2 21-Jun-17 9:51am View
   
i did. but it doesn't include what i asked. i need it to spin up and down in half-an-hour boundaries.
ilostmyid2 31-Jan-17 8:04am View
   
i gave the link to my code in my comment above.
the behavior of VS2010 is weird. the same code is working in the VS2015 and may be debugged also there. just in VS2010 and just when the program is paused by a breakpoint it can't be continued and the exception is thrown, regardless of where i put the breakpoint.
ilostmyid2 31-Jan-17 6:56am View
   
i say that i can't debug! you say the only way to fix it is to debug?!
ilostmyid2 31-Jan-17 5:20am View
   
in such a case i can't run the program in debug mode without an exception, but i do. i just can't debug.
ilostmyid2 31-Jan-17 3:21am View
   
http://pastebin.com/NC34qRWc
ilostmyid2 31-Jan-17 3:09am View
   
ok, i'm trying to reproduce it in a simpler code. the code is not the cause, because it's being run without any problem.
ilostmyid2 31-Jan-17 2:51am View
   
since it doesn't belong to me and i'm programming for someone else, i can't. but i wish i could.
ilostmyid2 11-Jan-17 12:59pm View
   
nothing yet. how do u know that?
ilostmyid2 5-Jan-17 3:42am View
   
oh my!
i changed the Windows to 7 with the same work of success! something seems to be wrong in XP
ilostmyid2 4-Jan-17 8:09am View
   
As I told before, it's before coding. Unless I may connect to the database directly by mentioning the Access file name from inside the program.
ilostmyid2 4-Jan-17 6:26am View
   
it's for when one want to access the db from withing the program. my problem is before beginning programming.
ilostmyid2 4-Jan-17 6:05am View
   
still not in programming to use a class.
ilostmyid2 4-Jan-17 6:04am View
   
Note that I'm still not going to access the database from inside the program. No program is still written.
About 64-bit issues, it's not applicable. I'm using Windows XP and it's 32-bit in architecture. So, the access issue is also not applicable.
About the DB Engine. I thought no other thing is required when I'm using an Access file as my database. When VS has such a dialog to connect to an Access file as a database, it should recognize the database directly without using any engine. I thought all connections to such file should be implemented internally. If I'm in mistake, please let me know what exactly I've to do. What's ACE? Should I install something other than Access and VS?
ilostmyid2 14-Dec-16 6:10am View
   
ok, i got the sense of what you mean. so you're sure that the Telerik code has no problem and if i get the exception it's just because of bad input. right?
ilostmyid2 14-Dec-16 5:03am View
   
rehi
now i'm reading your text. let me say that i'm not so much newbie in programming. if you check the call stack i sent, you see that no clue of my functions is there. this happen inside the Windows and telerik codes itself. i've not their code to set a breakpoint at them and debug. i'm also not responsible for their code. if this call stack causes the error, so others should have the same problem.
so it's better to ask you for a clue.
thx
ilostmyid2 13-Dec-16 12:31pm View
   
i think i couldn't describe my problem well. the vmware virtual machine is located on a dual-cpu xeon each have 8 cores. no cpu usage is high. the machine is assigned 10 cpu's, 5 cores from each cpu. when i run 10 threads at a time, i see only the first cpu is involved with my process and threads, while all cores of the other cpu are idle.
ilostmyid2 12-Dec-16 12:21pm View
   
thank you for the response. since it's late night now, and i'll not be at work tomorrow, i will check it the next day.
regards
ilostmyid2 1-Nov-16 11:26am View
   
this is really a good answer and includes all guides a complete solution should.
thx
ilostmyid2 1-Nov-16 11:14am View
   
yeah, exactly. thank u. now i've upgraded my vs to 2015 and project is converted. but in vs 2015 the same error happened and when i changed _T to _t the problem was solved. thanks
ilostmyid2 1-Nov-16 9:40am View
   
i switched to vs 2015. in 2010, i got an error like this:
undefined variable ar
sorry if i was lazy
ilostmyid2 1-Nov-16 9:38am View
   
u did it in vs 2010?
ilostmyid2 1-Nov-16 9:03am View
   
the question is clear. cpp compiler which is used by vs2015 can compile the code, while the cpp compiler of vs2010 can't. it's a bug or lack is what i don't know. but there should be a way to update the vs2010 compiler to be able to compile the code as vs2013 and vs2015 do.
upgrading vs environment is a thing and updating the compiler it uses in completely another thing.
for example, gcc maybe upgraded, while ubuntu is the same.
ilostmyid2 1-Nov-16 8:30am View
   
u mean there's no update for VS 2010 to solve the problem and i've no choice other than changing VS version?
ilostmyid2 1-Nov-16 7:50am View
   
hmm, in glimpse, my question is that is there a way to upgrade c++ compiler in VS 2010?
ilostmyid2 9-Jan-16 1:54am View
   
1. I'm not familiar with HDD hardware or firmware. I judge based on what I see. I see that this happens.
2. I'm not going to copy the HDD in an image file. My idea is to copy a hard into another, /dev/sdc to /dev/sda. I'm not the one who decrypts the second HDD. I will give it to Windows and when it finds the same content, I hope it will be able to decrypt it.
3. How switching the power on and off may increase bad sectors?!
4. I found that the HDD becomes more unreadable as much as I use it. Maybe heads are closer to surface than expected and this caused them to scratch the surface more and more. So I thought it may be better not to read it and take it to a service company. I hope they may recover it.
ilostmyid2 9-Jan-16 1:45am View
   
Hi Sergey. I'm happy to have a reply of you. I may code in C# in Windows or C in Ubuntu. Which one is better? I think since i may work with the HDD in lower-level API's in Ubuntu, it's preferred. But both are Ok for me.
ilostmyid2 8-Jan-16 12:52pm View
   
i'm not looking for a tool. i'm looking for a way to write the tool.
ilostmyid2 8-Jan-16 12:42pm View
   
i need something simpler preferred in ubuntu, like:
void main()
{
char buf[512];
for (int i=begin; i<end; i++)
{
absread(i, "/dev/sdc", 512, buf);
abswrite(i, "/dev/sda", 512, buf);
}
}
ilostmyid2 8-Jan-16 12:02pm View
   
i'll certainly try the solution. but the problem is something different. consider and example. sectors 0 to 100 may be read successfully. then sector 101 is read. it's defective. (it's an example). dd or ddrescue tries to read, can't and so skips. my word is that reading from sector 101 causes the drive to fail any further reads, even 0 to 100. for this, i need a program and i think i've to write it to have control over it. if so, i turn the hdd off, and on again, and relaunch my program and tell it to begin from sector 102. maybe 102 to 157 reads successfully and the process will begin with sector 159.
ilostmyid2 8-Jan-16 10:55am View
   
how can i make sure that the problem is the disk surface, head etc. or the controller?
anyway, you don't give me a method for writing the program.
ilostmyid2 8-Jan-16 10:54am View
   
this is the higher level method. first, i've to try to make an exact copy.
ilostmyid2 8-Jan-16 10:53am View
   
yes, the holes will exist anyway. i say the result will be the best approach to the data i can retrieve.
ilostmyid2 8-Jan-16 8:53am View
   
how u say that? regardless of the source hdd how encrypted, the resulting hdd should be the same, because contains the same data. if Windows may unlock the source hdd (which is the case), the same Windows may unlock the destination hdd too, because it encounters the same data. maybe i'm talking about a lower-level treating with an hdd.
please just tell me the way to programmatically copy the source hdd into the dest hdd. this is a programming forum.
ilostmyid2 8-Jan-16 7:55am View
   
i hope ddrescue doesn't fall into the state which it can't read any sector and i've to turn the hdd off and then on.
ilostmyid2 8-Jan-16 7:51am View
   
since the partition is indeed an NTFS partition encrypted by BitLocker, i prefer not to use any higher level program like testdisk and dislocker, etc. i prefer to make a sector-by-sector copy to another hard disk. for the effect i told, which causes the source hdd not to be readable even from safe sectors after i read from special sectors by dd, i still prefer to write a program for this purpose. ddrescue is doing something, but at the same i want to begin writing the program.
ilostmyid2 8-Jan-16 7:32am View
   
Tomas: no, i didn't. how can i install it?
Richard: I'll do it after my tries fail.
Jochen: thx, going to view
ilostmyid2 8-Dec-15 9:15am View
   
there's no option for this. ms also doesn't reply. i tried ms forums.
ilostmyid2 8-Dec-15 3:10am View
   
so, if a new partition of type ntfs is made, this is the Windows that sets the permissions. right?
ilostmyid2 8-Dec-15 3:07am View
   
i followed the link. as well i searched for such an option in accounts section. it doesn't exist.
ilostmyid2 7-Dec-15 22:29pm View
   
it's indeed a local account. indeed the local built-in Administrator account!
ilostmyid2 7-Dec-15 16:03pm View
   
oh i found that it was not dependent to BitLocker at all!
it was a security issue.
when i referred to security settings i found that the same users (Administrator and System) are granted to access the content of the hard disk. this shows that they use the same SID's. but it couldn't show the owner. i changed it to "Administrators". but this didn't solve the problem. the only thing which caused the content to get browsable and solved the problem was that i change owner to "Everyone"! but why?
ilostmyid2 7-Dec-15 12:56pm View
   
thx 4 replies
SID i meant, which is indeed a Globally Unique IDentifier.
when u install Office, for example, you see that its registry entries for CLSID's are the same in all machines. i expect the built-in Administrator has the same SID in all machines. am i right?
i changed all files and folder's permissions with no success.
if the problem is file-system related, even total commander should not be able to open items too.
ilostmyid2 19-Aug-15 6:36am View
   
i answered in the following section.
ilostmyid2 19-Aug-15 3:18am View
   
you should say the same for C++ environment. so why did they put Ctrl+T there?!
ilostmyid2 18-Aug-15 15:17pm View
   
consider a situation in which the code is not compilable. ie. when there're some errors in it. eg. when adding a whole new part which code is not yet complete.
i encountered this requirement when i saw the different is aspect while designing and when i run my program.
ilostmyid2 18-Aug-15 5:52am View
   
thanks to both
so i think simply testing a form just to see its aspect before running the program and examine how it really appears at run-time leads to a complex solution. i'm not familiar with "unit test" concept, and as i see after your comments, i've to investigate in it and improve my knowledge about it.
i'll begin with your links and hope to find interesting things.
ilostmyid2 18-Aug-15 3:17am View
   
i'm not expert in this context. would u explain pls?
ilostmyid2 18-Aug-15 3:16am View
   
i'll try .net unit test. is it a utility?
how to setup a precompile command?
ilostmyid2 13-Aug-15 11:01am View
   
domain's group policy should not be applied to local users. should be?
ilostmyid2 13-Aug-15 5:47am View
   
it's mine. i found the reason. but don't know why!
it was because it was joined to a domain. when i disconnected it from domain, all fields got changeable.
i wonder why this should be the cause while it was a local user!
ilostmyid2 28-Jul-15 9:03am View
   
:) i've talked to him today. it seems that the company's policy is not to open the ports.
see, i've a server outside. so client/server solutions may work. is there any?
ilostmyid2 5-Jul-15 11:46am View
   
which FAQ u mean? maybe i didn't bring up a problem and i just exposed a question to discussion. but it doesn't mean that it needed any clearance.
ilostmyid2 5-Jul-15 8:24am View
   
how do you say that? it's not in my mind. i've told it. time syncing is the problem. ok. but i should use a proxy server to connect to the internet. so the solution "settings on my Windows clock" doesn't work, because there's no way to configure it to use a proxy. it just works when i connect to the internet directly. another problem is that the proxy server just routes http packets, not ntp packets. so i can't use software which use this protocol.
you see that i had described the problem well.
the solution is to use htpd.
http://www.rkeene.org/oss/htp/
ilostmyid2 5-Jul-15 7:51am View
   
in stackoverflow, i told the problem and got the answer, and here you're still looking for the problem clarification!
it's really clear. describe what?
thx anyway
ilostmyid2 26-Jun-15 20:35pm View
   
yeah, it seems that ur right. it seems to be unicode. but what happened to the original that made the final? i need a rollback algorithm.
ilostmyid2 19-Jun-15 6:51am View
   
thank u :)
ilostmyid2 8-Jun-15 11:46am View
   
but my project is in VS and i need the behavior of gcc in VS. what can i do? do newer versions of VS resolve this issue?
ilostmyid2 8-Jun-15 10:06am View
   
look at my source. with this i still get 0,2:
#include "iostream"

#pragma pack(1)

using namespace std;

void f2()
{
struct s1
{
char b:2;
bool c:1;
long d:4;
short a:9;
};
union s2
{
s1 c;
short d;
};

s2 e;
e.c.d = 5;
e.d = 0; // i expect that a & b of c both get zero
cout << (int) e.c.d; // but b doesn't

cout << "," << sizeof(s1) << endl; // because d doesn't cover b
}

int main()
{
f2();
return 0;
}
shame on u MS! shame on u!
ilostmyid2 8-Jun-15 9:58am View
   
wow man! i even changed places of a and b in s1 and the result is still 0,2! haha! this is the compiler i'm looking for.
i had discovered another elegant capability in gcc before. 0b001100.. is meaningful for gcc, while it's not for msvc. and again another capability is now discovered.
ilostmyid2 8-Jun-15 9:54am View
   
haha, g++ works great. This is the difference between a professional compiler and a commercial one. No Microsoft! Everything is not business. Try to be a bit professional. I tried the code in Ubuntu 12.04. The g++ outputs 0,2 as i expected. Shame on you, Microsoft! Ah!
ilostmyid2 8-Jun-15 9:42am View
   
i prefer not to use the same types to indicate for the compiler what variables must group. for example, i want to set one to 'bool' to assign 'false' or 'true' to it instead of integral values.
since you said that you're certain that there's no way to tell MSVC to change this behavior, i mark your answer as the solution, but i'm still angry that there's no way.
now i'm going to test it in gcc. did u examine BC?
ilostmyid2 8-Jun-15 9:41am View
   
Deleted
i prefer not to use the same types to indicate for the compiler what variables must group. for example, i want to set one to 'bool' to assign 'false' or 'true' to it instead of integral values.
since you said that you're certain that there's no way to tell MSVC to change this behavior, i mark your answer as the solution, but i'm still angry that there's no way.
now i'm going to test it in gcc. did u examine BC?
ilostmyid2 8-Jun-15 8:37am View
   
i think i know enough about bitfields after 20 years of programming in C. the fact is that the compiler acts incorrectly. the behavior in unexpected. it seems that MS doesn't believe in packing. as the default structures member alignment is not 1 byte.
i need an option to change this behavior.
any idea?
ilostmyid2 8-Jun-15 8:32am View
   
thanks for your investigation and description. this describes in details what actually is happening, but doesn't explain what to do to reach the same behavior i expect with the same data types. if i'm not wrong, when i was programming in BC++, it would behave correctly. regardless of data types, i've defined explicitly how many bits the variable should occupy. wasting other bits is not justifiable. then, the bits should be looked as the data types i've specified.
anyone knows how to change the vs 2010 compiler behavior to act correctly?!
ilostmyid2 4-Jun-15 11:53am View
   
yeah, but not exactly source control. i need to have my sources everywhere i go. so i put them in DropBox. and i don't want to include garbage files in the folder.
ilostmyid2 18-May-15 17:18pm View
   
unfortunately none of them include path for creating APS file.
ilostmyid2 1-May-15 22:08pm View
   
Thanks for the answer.
The behavior is that the view loses the focus.
Let me describe in more details. The pane has a title, which changes in color when it's, let's say, activated. Controls in the pane are a tab control and a custom view of type CSrollView which holds the buttons (images which are simply CWnd's). What i want is that the pane and its children can't get focus and can't get activated. For example, now, when i click on the tab control, it gets activated and receives keyboard events and i may change the selected page in the pane by arrow left and arrow right. I want the "view" remain focused, the pane title color don't change and MFC suppose that the pane and its children can't get focused.
ilostmyid2 23-Oct-14 11:12am View
   
is there any debugging tool to assist me in finding the source of the problem?
can i use crt functions like _CrtSetDbgFlag for this purpose?
there must be a way in locating the problem automatically.
ilostmyid2 6-Oct-14 11:02am View
   
this is true only if my process has created the child process. if the process has been running before my process, or after my process but has been brought up by a user, then i can't check it.
ilostmyid2 6-Oct-14 9:45am View
   
then i should end the process? this way, i need to first execute the program and then figure out that it has been running. what i want is to prevent it to be executed again. there should be an IN parameter for this purpose, like a flag to specify it should be run as single-instance.
ilostmyid2 5-Oct-14 16:11pm View
   
thanks for the link. but it's for C#, not C/C++.
ilostmyid2 4-Oct-14 11:25am View
   
in task manager we see list of all running programs/processes. we may also bring a specific program to front. this is exactly what i need to do in my program.
ilostmyid2 4-Oct-14 0:51am View
   
this may help only if the only one who may execute the program be my own program. it doesn't help when the program is already running, even before my program. i want to bring it to front in such a case. it's enough that it be running. in such a case, i don't want to execute it again.
ilostmyid2 3-Oct-14 1:07am View
   
thanks
such a management seems somehow complicated.
isn't there an easier way to check it?
let's concentrate on what i really want. i'm going to execute a program or if it's already running (by my program or user), bring it to front.
ilostmyid2 2-Oct-14 10:20am View
   
yes, i do. indeed it returns the handle to the new process and its process id as well as these info about its primary thread. but how can it help?
ilostmyid2 2-Oct-14 10:11am View
   
2. good idea, but i can't find out when the child program is closed so that i may enable it again.
ilostmyid2 2-Oct-14 10:11am View
   
Deleted
2. good idea, but i can't find out when the child program is closed so that i may enable it again.
ilostmyid2 2-Oct-14 7:16am View
   
sorry, it's in C++. i've no control over the child application. i've no access to its source. it's not my program.
ilostmyid2 29-Sep-14 9:03am View
   
thank you for the solution, but it's not applicable in my case, because i've no control over the proxy server.
ilostmyid2 7-Sep-14 7:58am View
   
support team has opened http on port 8080 and not going to open other ports/protocols. i've to use this port and if needed convert other protocols/ports to this.
ilostmyid2 7-Sep-14 6:55am View
   
hmm, i think i could not imply what exactly i meant, sorry.
i'm not going to view sites or access materials in the internet which are not accessible and are beyond the proxy server set in the company i work in.
there are many requirements for accessing the internet directly. instead of all programs to be able to utilize the proxy server, i prefer a separate program redirect them to internet. for example, consider i want to sync Windows time with time servers. here, i can't ask Windows to connect to the time server via a proxy. it won't work. so, i need a program to direct accesses to the internet, while i'm still beyond proxy. Windows should think that it's directly connected to the internet, while it's not and the program is handling the redirection and connect Windows and whole running programs via the proxy server.
ilostmyid2 3-Sep-14 0:15am View
   
thx :)
ilostmyid2 13-Jul-14 4:26am View
   
thanx, but my problem is before this. if a scrollbar receives mouse move or other mouse events like hover, etc. its appearance change, eg. its buttons at start and end and also the thumb button is repainted to show that they're ready to be clicked on or dragged. in my case, no such visual effects appear. it seems that they're not receiving mouse events and the pane instead receives them.
another pane in my program includes a property grid. its scrollbar has no problem. when i referred to its implementation, i saw that the scrollbar there is a separate ctrl. i think i've to use a separate ctrl for scrollbars and can't enable the toolbox ctrl's scrollbars for this purpose. why? i don't know. and i'm also not sure about this idea.
ilostmyid2 6-Jun-14 19:41pm View
   
so you suggest to remove the question itself instead of finding a good answer to it?!
ilostmyid2 6-Jun-14 18:37pm View
   
ok. thank you for your reply.
although it's not a special code and indeed my code didn't cause the problem and the MFC itself seems to cause the flicker, i updated the question to include to code too.
ilostmyid2 18-Jan-14 3:10am View
   
besides, i realized that the same function may be used to convert a single unicode char to a single multibyte one too.
ilostmyid2 18-Jan-14 3:07am View
   
ok, now i checked WideCharToMultiByte and it works :)
but the problem still exists. i can't force fputws to use this function for converting the input argument to multibyte. it internally uses wcstombs. it seems that the only way is to convert it to multibyte in memory and write the result into the file by fputs, not to use fputws.
anyway, your last comment solved my problem. please add it as a separate solution, so that i can rate (accept) it.
thx
ilostmyid2 17-Jan-14 23:33pm View
   
no, i mean a conversion of a single char instead of a string of chars.
ilostmyid2 17-Jan-14 8:26am View
   
thx, i'll check it. does it have a single byte version?
ilostmyid2 15-Jan-14 5:11am View
   
Deleted
i added the following line:
_locale_t l = _get_current_locale();
and see that l.locinfo.lc_codepage is 0 while system locale is 1256. can i conclude that visual studio 2010 doesn't follow system locale? wCodePage in l.locinfo.lc_id is also 0!
ilostmyid2 15-Jan-14 5:06am View
   
i added the following line:
_locale_t l = _get_current_locale();
i see that l.locinfo.lc_codepage is zero while the system locate is set to 1256. maybe visual studio (2010) doesn't know and may not adapt itself to system locale? wCodePage in l.locinfo.lc_id is also 0!
ilostmyid2 15-Jan-14 1:42am View
   
or r in this code:
wchar_t wc=L'\x633';
char c;
int r=wctomb(&c,wc);
why gets -1?
ilostmyid2 15-Jan-14 1:36am View
   
so the problem gets simpler. in the following code:
wchar_t *uctext=L"\x633";
int sz=wcstombs(NULL, uctext, 1);
what's wrong that causes sz to get -1 and errno get EILSEQ?
ilostmyid2 15-Jan-14 1:25am View
   
thanx to both. yes, i checked errno and found the same value. but it's weird. what's in the string which cannot be converted? we know that all unicode characters have equivalents in multibyte sequence form. i changed it to a simpler unicode string, a single arabic letter seen (U+0633). i also thought the editor may not correctly provide the string. so i used "\x633" instead of entering the letter directly into the string. but the result was the same.
what's wrong?!
ilostmyid2 14-Mar-13 5:57am View
   
yes, but for this trim must be added to the dialog size not to the CStatic size.
ilostmyid2 14-Mar-13 5:56am View
   
Deleted
yes, but for this trim must be added to the dialog size not to the CStatic size.
ilostmyid2 14-Mar-13 5:19am View
   
thanx 4 the solution :)
i couldn't communicate with the second paragraph. how that i've to add the trim to the size of the static ctrl?!
ilostmyid2 14-Mar-13 4:46am View
   
it's just for me to know when i've posted the question. because i'm not familiar with gregorian date, i use our own calendar. today is 1391/12/24.
ilostmyid2 14-Nov-12 7:20am View
   
ur right. this is a good solution to add a parameter to all web services to know who is the caller and simulate sessions this way. but i like to know whether it may be done automatically somehow eg. by filling some attribute in http protocol header, etc.
ilostmyid2 13-Nov-12 11:19am View
   
client is C# and web services are located on Linux Ubuntu.
ilostmyid2 27-Oct-12 2:39am View
   
in AssemblyInfo.cs whenever i change -1 to 0 and try to build, this file is regenerated (by who?!) and -1 is returned back.
version is important for me. i referred to the link, but it's not applicable for me, because there's no Microsoft.VersionNumber.targets file.
ilostmyid2 19-Jul-12 3:49am View
   
so u believe that the source is the MDB file. how can i check that it's setup to auto-decrement? i found no option when i opened it in access.
ilostmyid2 25-Jun-12 4:03am View
   
thanx for the solution
u know, i include name of a color in an obj because it's enough. there's no need to include all properties of a color also in obj. what can i do if i want to do so?
ilostmyid2 21-Jun-12 3:53am View
   
_Superman_ gave the solution, thanx
ilostmyid2 21-Jun-12 2:45am View
   
oh thank u :)
it solved the problem
ilostmyid2 21-Jun-12 2:42am View
   
what's Set Buddy Integer property of the spin ctrl and how can i set it?
ilostmyid2 21-Jun-12 2:40am View
   
yes, but it has no effect
ilostmyid2 12-May-12 2:28am View
   
ok, thank u :)
indeed the question is answered here:
http://stackoverflow.com/questions/10532904/910221-it-seems-that-service-method-are-not-really-called-asynchronously/10534028#10534028
it's the limitation IIS causes. i would like to know whether linux has the same behavior.
ilostmyid2 10-May-12 2:57am View
   
ok, for your ease, i changed the code a bit. you may look here:
http://www.codeproject.com/Questions/382077/910221-service-methods-run-dependently
ilostmyid2 1-May-12 2:56am View
   
thank u for ur answer
resize is continually generated.
the fact is that the event might be raised, because we've ResizeEnd in a form application and essentially all windows receive WM_EXITSIZEMOVE and this could not be neglected. this is the fault of MS that it doesn't capture the message and dispatch it throw Silverlight.
but, since the message EXISTS, there must be a way or workaround to write an unmanaged code to capture it.
any suggestion?
ilostmyid2 30-Apr-12 8:20am View
   
so how can i grab the mouse events belong to the non-client area parts of the browser?
indeed i need to know when use release the left mouse button (mouse up). by this method i want to know when resize is done.
ilostmyid2 29-Apr-12 11:19am View
   
thanx 4 the linx
i tried to figure out what does the first one wants to say. unfortunately i couldn't realize the nature and the message of what he wants to do. it seems a fairly complex code. i couldn't find what "updating" does. then, i don't think this may help. LayoutUpdated and SizeChanged both are raised while resizing, not just at the end.
about the second link, the only where i can find Resized is at my App.Current.Host.Content.Resized. i set it, but it also is not raised only at the end of resizing and treats the same.
ilostmyid2 15-Apr-12 4:21am View
   
indeed, i want to use it in web and it needs to be on a control for panning.
i believe that the problem won't be resolved if the picturebox gets omitted.
i read the link, thanx
ilostmyid2 14-Apr-12 9:48am View
   
thanks for your answer.
indeed setting the interpolation to NearestNeighbor causes the problem to get exposed better. i've a project in which the interpolation is not set (the default is used). since this gap effect happened there, i decided to write a test code and found that it appears in both cases of default interpolation mode and non-default interpolation mode.
now, is it a bug? how can i resolve it? it seems not to be reasonable.
for more discussion, please come here:
http://stackoverflow.com/questions/10152225/another-unexpected-result-from-graphics-drawimage
i've described more about it.
thanks
ilostmyid2 12-Apr-12 12:20pm View
   
i've to think more about what u said and examine it in the code.
thx
ilostmyid2 12-Apr-12 12:06pm View
   
i need to pay attention to the messages for that i need to know when and in what function i have to update the property list.
ilostmyid2 12-Apr-12 11:27am View
   
this is also a problem! see the following:
t22 activated, t21 deactivated, in CChildFrame::OnMDIActivate
t21 activated, t22 deactivated, in CChildFrame::OnMDIActivate
t22 activated, t21 deactivated, in CChildFrame::OnMDIActivate
t22::OnDraw
t21::OnDraw
this is the result of two traces, one in CChildFrame::OnMDIActivate and one in Ct2View::OnDraw. this is the result of a File/New command. it indicates that when i add a new document, it gets first activated, then deactivated, then activated again, then drawn and then the deactivated view is also drawn! when the MDI application is of kind tabbed views, how this behavior is justifiable?
so my questions are:
1. after activating the new document, why it gets deactivated and activated again?!
2. a view which is completely hidden must not be drawn.
ilostmyid2 12-Apr-12 11:02am View
   
thank u :)
i added ON_WM_MDIACTIVATE to the child frame's message map and added the handler CChildFrame::OnMDIActivate. is it ok?
ilostmyid2 11-Apr-12 5:52am View
   
and the following code:
void f9(Graphics g)
{
var img = new Bitmap(3, 2);
var memG = Graphics.FromImage(img);
memG.FillRectangle(new SolidBrush(Color.Black), 0, 0, img.Width, img.Height);
GlobalFunctions.PutPixel(memG, new Pen(Color.Red), 1, 0);
GlobalFunctions.PutPixel(memG, new Pen(Color.Blue), 0, 1);
GlobalFunctions.PutPixel(memG, new Pen(Color.GreenYellow), 2, 0);
GlobalFunctions.PutPixel(memG, new Pen(Color.Cyan), 2, 1);
var srcRect = new Rectangle(0, 0, img.Width, img.Height);
int factor = 100;
var destRect = new Rectangle(0, 0, img.Width * factor, img.Height * factor);
g.FillRectangle(new SolidBrush(Color.DarkCyan), pictureBox1.ClientRectangle);
g.DrawRectangle(new Pen(Color.Blue), destRect);
g.DrawImage(img, destRect, srcRect, GraphicsUnit.Pixel);
}
generates the following result:
http://www.uploadup.com/di-0B33.png
no description?
indeed i expect this to be the result of drawing an image which is 4x3 instead of 3x2 which its 3 right points and 4 bottom points be of color dark blue. got what i mean?
ilostmyid2 11-Apr-12 4:56am View
   
oh! i surrender understanding the behavior of DrawImage!
see what happened! with the 2x2 image changed to:
http://www.uploadup.com/di-WCGA.png
and the following code:
void f8(Graphics g)
{
var img = Image.FromFile(@"d:\small3.png");
var srcRect = new Rectangle(0, 0, img.Width, img.Height);
int factor = 50;
int w = img.Width*factor;
g.FillRectangle(new SolidBrush(Color.DarkCyan), pictureBox1.ClientRectangle);
var destRect = new Rectangle(0, 0, 3 * w, w); // assuming img.Width == img.Height
g.FillRectangle(new SolidBrush(Color.Chartreuse), destRect);
destRect.Y = 2*w;
g.FillRectangle(new SolidBrush(Color.Chartreuse), destRect);
destRect.X = 0;
destRect.Y = w;
destRect.Width = w;
g.FillRectangle(new SolidBrush(Color.Chartreuse), destRect);
destRect.X = 2*w;
g.FillRectangle(new SolidBrush(Color.Chartreuse), destRect);
destRect.X = w;
g.DrawImage(img, destRect, srcRect, GraphicsUnit.Pixel);
}
i get the following result:
http://www.uploadup.com/di-OMVI.png
it's weird! consider drawing the image after drawing the margin with color Chartreuse.
ilostmyid2 11-Apr-12 2:57am View
   
oh! i found that it depends on the color of the remainder part of the picture box! for example if i add the following code before DrawRectangle:
g.FillRectangle(new SolidBrush(Color.DarkCyan), pictureBox1.ClientRectangle);
the gradient effect which DrawImage causes gets between black to dark cyan!
i also change the srcRect from (0, 0, 2, 2) to (0, 0, 1, 1) and this time DrawImage doesn't produce the gradient effect.
someone describe please :(
ilostmyid2 10-Apr-12 15:06pm View
   
i tried another computer, this time a netbook, but with the same OS (Windows 7 Ultimate). it produced the same result. i think all must produce the same result and it must not be system/OS dependent. it depends on GDI+ and it's the same in all machines, i think.
ilostmyid2 10-Apr-12 14:54pm View
   
really?! what about the second one?
no, i've not. but i will.
it's weird that we may get different results on different machines!
it must be standard in all machines!
ilostmyid2 10-Apr-12 12:07pm View
   
ok, let me describe it with another example which contrasts the problem. for regenerating it, please go to Paint and create a 2x2 image and fill it with the black color. then save it as d:\small3.png. now you have a 2x2 image which its entire surface is black. then create a new C# form application in which a picture box inserted with no margin. then use the following code:
void f6(Graphics g)
{
var img = Image.FromFile(@"d:\small3.png");
var srcRect = new Rectangle(0, 0, img.Width, img.Height);
int factor = 400;
var destRect = new Rectangle(0, 0, img.Width * factor, img.Height * factor);
g.DrawRectangle(new Pen(Color.Blue), destRect);
g.DrawImage(img, destRect, srcRect, GraphicsUnit.Pixel);
}

private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
f6(e.Graphics);
}
i expect the entire rectangle inside the blue margins be black while the output is as follows:
http://www.uploadup.com/di-L034.png
why?!
i hope i could describe the problem well.
thx
ilostmyid2 8-Apr-12 7:15am View
   
the same problem must exist here too. how come T has a method called CompareTo?
ilostmyid2 8-Apr-12 7:13am View
   
i read the document, but have to honestly confess that i couldn't understand it, because it was too complex for me! :D
ilostmyid2 8-Apr-12 6:58am View
   
ok, in such cases i will define the operator for the class i pass as T, i promise! otherwise compiler has right to generate error! in C++ it doesn't generate such an error until it sees that i've called an undefined operator. why here is not so?
going to read the document.
thx
ilostmyid2 18-Mar-12 13:30pm View
   
ur welcome :)
ilostmyid2 18-Mar-12 12:46pm View
   
sure :)
ilostmyid2 18-Mar-12 5:23am View
   
thank everyone who replied. :)
ilostmyid2 17-Mar-12 11:46am View
   
thank u :)
ilostmyid2 15-Mar-12 14:40pm View
   
thx, i will study more about it.
ilostmyid2 15-Mar-12 11:01am View
   
it's interesting! so => is added by System.Linq? how is it possible? the compiler must be ready for the syntax. FirstOrDefault must be method of List. how can a special using namespace add a method to a class which is normally not in the class?!
ilostmyid2 15-Mar-12 9:57am View
   
oh thx, i got it! :)
ilostmyid2 15-Mar-12 9:50am View
   
Deleted
sorry, i didn't get the solution.
ilostmyid2 15-Mar-12 9:22am View
   
misunderstanding?! what's the correct meaning?
ilostmyid2 15-Mar-12 9:17am View
   
the same problem with Solution 3 exists here too:
private static void Main(string[] args)
{
var list = new List<mystruct>();

//add items to the list
list.Add(new MyStruct(5));
list.Add(new MyStruct(10));
//To find an item of list matching an Id say 5 use the Find method with a predicate
MyStruct foundStruct = list.Find(myStruct => myStruct.Id == 5);
foundStruct.Id = 1;
Console.WriteLine("list[0].Id={0}", list[0].Id);
Console.ReadKey();
}
here list[0].Id is still 5. this indicates that foundStruct is a separate object than list[0], not to be a reference to it.
ilostmyid2 15-Mar-12 9:06am View
   
indeed what find returns in your code is not the same object existing in the list. i need a reference to that object. for example if i change the Main function to this:
static void Main(string[] args)
{
MyStruct mystruct = find(1); // reference to your original list object
mystruct.Id = 5;
Console.WriteLine("list[0].id = {0}", list[0].Id);
Console.ReadKey();
MyStruct mystructEmpty = find(999); // empty
}
you see that list[0].Id is still 1, not 5!
ilostmyid2 15-Mar-12 8:36am View
   
yeah, ur both right. but what i want to do is a bit different. when returning result via arguments there's no problem, but i want to return the reference from function.
ilostmyid2 14-Mar-12 22:55pm View
   
thx :)
it's apparently not possible that an item in the list ctrl gets selected or deselected while it's not focused. so is checking the button not to be focused while this notification is received necessary?
ilostmyid2 14-Mar-12 12:33pm View
   
yes, i've changed them back to ON_BN_CLICKED and they also work for enter and space keys. now consider i'm going to enable and disable the button in case the user selects an item in the list or deselects it. when must this be handled?
ilostmyid2 14-Mar-12 12:18pm View
   
thank u. that was a very good guidance. but if i could use the UI mechanism, the button would get enabled and disabled automatically. where do u think to be the best place for putting the code? the button is disabled if no item in a list ctrl is selected and enabled otherwise.
ilostmyid2 13-Mar-12 13:18pm View
   
thx
ilostmyid2 13-Mar-12 9:39am View
   
should think more about it. ur right somehow, but backward compatibility may be an option for the compiler. an example is Microsoft specific extensions. when i'm not going to port my application to several platforms, i don't care about compatibility. "how to compile" may be chosen by programmers. improvements must not stop for compatibility. code converters may be invented in the worst case. otherwise, the option may be enough.
i think our approaches differ. once C++ didn't exist. once even C didn't exist. v've (we have) to change to achieve new facilities and capabilities. the problem is that can we agree with some new features to be added to C++ version x.xx or not more than the problem be backward compatibility. don't forget that v're the ones who make inventions.
thx, the links and ur text may be a good reference.
ilostmyid2 13-Mar-12 9:08am View
   
thank u :)
1. what's the problem with the code i wrote?!
2. it worked, but is it possible to setup a handler for WM_ERASEBKGND and call FillSolidRect there? if so, which one of the two ways is better?
thx
ilostmyid2 13-Mar-12 7:24am View
   
it's still easy to read.
عادت کرده‌ایم همیشه راحت بودن رو فدای تشریفات کنیم!‏
sorry, i couldn't translate it because my mother tongue is not English.
ilostmyid2 13-Mar-12 5:06am View
   
i would prefer to use C if i would like to write a program to be close to metal. in C++ some things are not object, while the language intended to be object oriented.
about the first section, thank u, i will keep them in mind and if i will read some documents containing "class definition" i hope i won't forget to inform u, although u said that the Microsoft documents must not be treated as criterion. would u give me the source document of what is called a class declaration, pls?
i still believe that a const aggregate is implementable by the compiler and there's no need for a static instance. i also believe that there's no proof for a non-static const integral value not to be initializable inside a class declaration/definition. a const data member would better not to be treated as a data member! it's const anyway. so there's no need to allocate a space for it to consume in run-time!
i know that i've no choice. i'm not the designer of C++ and nothing changes by my opinions, but i think it's a good idea to think and discuss about what would be better to be noticed when designing. maybe the designers or MS ppl come here and see our discussions and upgrade their newer versions based on what they think to be more logic between our words, even though it becomes more MS specific and gets more non-standard. then, maybe the standards get updated based on what we think to be more logic.
i also thank u for "forward declaration" phrase. i'd not heard it b4.
ilostmyid2 13-Mar-12 0:27am View
   
hi thank u for replying. i think ur an expert in C#. i will keep ur advice in mind.
i found the source of the problem. indeed step 3 is a good solution. the problem was with a data member initialization. it was of type Size and for i can realize that it's not still assigned i'd initialized its width with -1. this would cause exception because it didn't expect that a Size.Width get negative! :)
ilostmyid2 13-Mar-12 0:14am View
   
i thought like u b4 about definition of a class and its difference with a class declaration. but after reading some pages in MSDN i found that a class declaration is like:
class CSomeClass;
and its definition is like:
class CSomeClass
{
...
};
the definition of class member functions differs from the definition of the class itself. what we see in a class definition is its member functions declarations. the definitions of the class member functions is usually put in source files. a function declaration may be called its prototype. defining an instance to a class differs from defining the class itself.
still about 2, maybe a good justification, but not fitting into one instruction may not be a problem. assigning a block of const data in compile time whenever needed may not lead to allocating a block of data in run-time. i think "they just didn't want to implement it", not it's semantically confront logic. this causes me to allocate a block of data in run-time which is const and don't need to be modified!
about 3 i think u mean what VS calls aggregate, right?
indeed it's about 3 months i've begin coding in C# and found it so amazing. it's more object oriented. there's no basic type. everything is derived from object. many things that is not possible in C++ is possible there. u don't have to worry about many things, eg. buffer overrun, etc. maybe this is why my expectations r upgraded! :D
thank u. treating a static const int as a const involving in machine code instructions maybe a good justification, although i still think that there might still be good ways to implement non-integral types. there're floating point registers for example in many CPU's. i think they've stopped upgrading C++ more than this. maybe a C+=2! language must be invented! :D
thank u anyway
ilostmyid2 12-Mar-12 4:52am View
   
thx, i didn't know that!
i will investigate on it further.
ilostmyid2 12-Mar-12 4:43am View
   
the rules are put off based on the semantic limitations...
never mind, i had no choice to change my code :(
ilostmyid2 11-Mar-12 23:49pm View
   
hi thank for replying
1) i couldn't find what u meant by conformant.
2) i couldn't find what u meant by file level. do u mean a static const data member must be initialized in the source and can't be initialized in the header file at class/struct definition? if u mean this, it's the source of my question, not the answer. why it must not be possible to initialize a non-integral static const data member of a class in the class definition? what's the logic beyond it?
3) i couldn't find what u meant by plain old data.
4) my question is exactly this. why i must move the initialization outside of the class definition?! now i've no constructor.
i think the solution is a workaround for the code to work. thank u, but i wanted the answer to the "why" i asked.
ilostmyid2 11-Mar-12 23:29pm View
   
i'm sorry that u think so! it's about 28 years i'm programming! beginner in what?! don't forget that many inventions are result of laziness. otherwise, we would not have washing machines, cars, calculators, even electricity, etc. the man always looks for a better way in life and facility for doing his works and u should not blame him for that! when i repeatedly build to fix a plenty of errors, i've right to expect to focus on first error by just a hotkey and have not to switch every time back to the error window by mouse, scroll it and double click on the first item. if u've experienced it, u know what i'm saying and that it's not a great expectation.
the VS doesn't automatically open the error list window until the compilation is done and i'm not going to wait until then! ideal is that i may go to the line of error in the editor as soon as it finds it. Borland C++ had the feature to stop compiling after hitting an specified number of errors which Microsoft is not going to implement it ever! what u want me to do and have no complain is to wait until the compilation ends, press Ctrl+Home and use mouse for double clicking the first item, and if i'm not easy with it, i'm a lazy person and a beginner in programming! i would like to know if others have the same opinion.
instead of finding a way for that and blaming Microsoft for not giving a user-friendly way, ur blaming me for a thing u call laziness!
ilostmyid2 11-Mar-12 15:55pm View
   
i couldn't figure out what u meant by extension.
i also don't know what u mean by the tutorial.
sorry
ilostmyid2 11-Mar-12 15:17pm View
   
native C++
ilostmyid2 11-Mar-12 13:50pm View
   
yeah, i know that the compiler generates errors for it. but my question is that why semantically it must not be true?
ilostmyid2 11-Mar-12 13:48pm View
   
i couldn't. would u show me how, please?
thx
ilostmyid2 11-Mar-12 13:03pm View
   
if u mean F8 may be the hotkey i'm looking for, i've to say that, no, it's not!
if i'm in the text editor and have already searched for something and currently the Find Window is active between windows which F8 goes to the next location in them, then F8 goes to the next found item. i need a hotkey which brings up the Error List window even though it's closed and goes to its FIRST item even though its fifth item between the whole ten items in it is currently focused. is THIS achievable?
ilostmyid2 11-Mar-12 12:36pm View
   
there's a window in Visual Studio called Error List. it may be shown by going to menu View, then Error List. when i build a project and it results in errors, the errors are listed in the window.
i need a global hotkey to go to the first item in the list.
ok?
ilostmyid2 11-Mar-12 11:28am View
   
thank u 4 replying
no, it's not going to implement a singleton. in singleton the instance is shared, while here an instance is used for initializing new instances. indeed instead of initializing data members separately in constructor, i would like to initialize new instances by the static instance.
everything is ok if i don't initialize the static instance inside the struct definition. "why"? this is what i can't understand. what's wrong if i initialize the static instance inside the struct definition while it's const when enums may be initialized by the same way. i think this is a lack of C++ or VC++ instead of error in my code. don't u think so? my code is logically true. if not, tell me why it's not.
thx
ilostmyid2 8-Mar-12 3:15am View
   
ok, i changed grid to canvas and changed the code as below:
Point mousePos = new Point();
Point currentPos = new Point();

bool isMouseDown = false;

private void image1_MouseMove(object sender, MouseEventArgs e)
{
if (!isMouseDown) return;
currentPos = e.GetPosition(null);
image1.SetValue(Canvas.LeftProperty, currentPos.X - mousePos.X);
image1.SetValue(Canvas.TopProperty, currentPos.Y - mousePos.Y);
}

private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
mousePos = e.GetPosition(null);
isMouseDown = true;
}

private void image1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
isMouseDown = false;
}
now i can change the image location. thx. now let's discuss about the following issues:
1. what differ what i pass to e.GetPosition?
2. how can i capture the mouse so that if its location exceeds beyond the boundaries of the canvas the MouseMove event still be sent to the image?
i used CaptureMouse and it has a different behavior from what i see in C++. in C++ when i call SetCapture all mouse events are received by the control that has called it. but here after calling CaptureMouse MouseMove event is not received by the control that has called it! as u used a bool variable for this purpose i should use one like isMouseDown. but it doesn't cause mouse events to be received by the control when the mouse cursor gets out of boundaries of the user control. what can i do to still receive mouse events in such a case?
3. after i release the mouse button, the image that has been moved successfully remains at its last location and this is a right behavior as i expect. but if i click on the image again to move it again, it begins moving from top left corner of canvas, not from where it currently is. why is that?
thx
ilostmyid2 7-Mar-12 9:13am View
   
but i need the user control to be resizable and the image be resized if the user control is resized.
ilostmyid2 7-Mar-12 9:13am View
   
Deleted
but i need the user control to be resizable and the image be resized if the user control is resized.
ilostmyid2 7-Mar-12 5:28am View
   
hi thank u for replying
i think the most important part of ur code is calling SetValue of image. what does it do? i referred to MSDN and couldn't figure out what it really does. besides, i've used a Grid instead of Canvas for holding my image. i'm not going to persist on grid, but i thought it's more proper for my usage. indeed the image size is set automatically so that the entire surface of user control be filled. Stretch is set to None, but the image is created with the same size as the user control.
what method did u use in this code? moving the image control in canvas? if so, i can't move the image control, because it's the same size as the user control.
please describe more about it.
thx
ilostmyid2 6-Mar-12 1:18am View
   
hi thank u for replying.
it has not to be so early. i found that when LayoutUpdated is raised, the image dimensions are available in its ActualWidth and ActualHeight or in its RenderSize. but now there's another problem. how can i access image1 in xaml? the view model needs the dimensions and i instantiate the view model in the xaml. but i can't access the controls in xaml. if i handle the LayoutUpdated event in the code-behind to access image1, this time i have no access to view model.
how can i resolve this problem?
thx

Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180712.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid