Tuesday, March 17, 2020
Send Information Between Delphi Apps With WM_COPYDATA
Send Information Between Delphi Apps With WM_COPYDATA There are many situation when you need to allow for two applications to communicate. If you do not want to mess with TCP and sockets communication (because both applications are running on the same machine), you can *simply* send (and properly receive) a special Windows message: WM_COPYDATA. Since handling Windows messages in Delphi is simple, issuing a SendMessage API call along with the WM_CopyData filled with the data to be sent is quite straight forward. WM_CopyData and TCopyDataStruct The WM_COPYDATA message enables you to send data from one application to another. The receiving application receives the data in a TCopyDataStruct record. The TCopyDataStruct is defined in the Windows.pas unit and wraps the COPYDATASTRUCT structure that contains the data to be passed. Heres the declaration and the description of the TCopyDataStruct record: type TCopyDataStruct packed record dwData: DWORD; //up to 32 bits of data to be passed to the receiving application cbData: DWORD; //the size, in bytes, of the data pointed to by the lpData member lpData: Pointer; //Points to data to be passed to the receiving application. This member can be nil. end; Send a String over WM_CopyData For a Sender application to send data to Receiver the CopyDataStruct must be filled and passed using the SendMessage function. Heres how to send a string value over WM_CopyData: procedure TSenderMainForm.SendString() ; var stringToSend : string; copyDataStruct : TCopyDataStruct; begin stringToSend : About Delphi Programming; copyDataStruct.dwData : 0; //use it to identify the message contents copyDataStruct.cbData : 1 Length(stringToSend) ; copyDataStruct.lpData : PChar(stringToSend) ; SendData(copyDataStruct) ; end; The SendData custom function locates the receiver using the FindWindow API call: procedure TSenderMainForm.SendData(const copyDataStruct: TCopyDataStruct) ; var à à receiverHandle : THandle; à à res : integer; begin à à receiverHandle : FindWindow(PChar(TReceiverMainForm),PChar(ReceiverMainForm)) ; à à if receiverHandle 0 then à à begin à à à à ShowMessage(CopyData Receiver NOT found!) ; à à à à Exit; à à end; à à res : SendMessage(receiverHandle, WM_COPYDATA, Integer(Handle), Integer(copyDataStruct)) ; end; In the code above, the Receiver application was found using the FindWindow API call by passing the class name of the main form (TReceiverMainForm) and the caption of the window (ReceiverMainForm). Note: The SendMessage returns an integer value assigned by the code that handled the WM_CopyData message. Handling WM_CopyData - Receiving a String The Receiver application handles the WM_CopyData mesage as in: type TReceiverMainForm class(TForm) private procedure WMCopyData(var Msg : TWMCopyData) ; message WM_COPYDATA; ... implementation ... procedure TReceiverMainForm.WMCopyData(var Msg: TWMCopyData) ; var s : string; begin s : PChar(Msg.CopyDataStruct.lpData) ; //Send something back msg.Result : 2006; end; The TWMCopyData record is declared as: TWMCopyData packed record Msg: Cardinal; From: HWND;//Handle of the Window that passed the data CopyDataStruct: PCopyDataStruct; //data passed Result: Longint;//Use it to send a value back to the Sender end; Sending String, Custom Record or an Image? The accompanying source code demonstrates how to send a string, record (complex data type) and even graphics (bitmap) to another application. If you cannot wait the download, heres how to send a TBitmap graphics: procedure TSenderMainForm.SendImage() ; var ms : TMemoryStream; bmp : TBitmap; copyDataStruct : TCopyDataStruct; begin ms : TMemoryStream.Create; try bmp : self.GetFormImage; try bmp.SaveToStream(ms) ; finally bmp.Free; end; copyDataStruct.dwData : Integer(cdtImage) ; // identify the data copyDataStruct.cbData : ms.Size; copyDataStruct.lpData : ms.Memory; SendData(copyDataStruct) ; finally ms.Free; end; end; And how to receive it: procedure TReceiverMainForm.HandleCopyDataImage( copyDataStruct: PCopyDataStruct) ; var ms: TMemoryStream; begin ms : TMemoryStream.Create; try ms.Write(copyDataStruct.lpData^, copyDataStruct.cbData) ; ms.Position : 0; receivedImage.Picture.Bitmap.LoadFromStream(ms) ; finally ms.Free; end; end;
Sunday, March 1, 2020
Word Choice Rout vs. Route - Proofread My Papers Academic Blog
Word Choice Rout vs. Route - Proofread My Papers Academic Blog Word Choice: Rout vs. Route Ah, the English language, will you ever stop confusing us? Why, for instance, would anyone think itââ¬â¢s a good idea to have two words which differ in meaning and sound different, but which are spelled almost identically? It beats us, yet thatââ¬â¢s what we have with ââ¬Å"routâ⬠and ââ¬Å"route.â⬠Itââ¬â¢s easy to get these words mixed up, especially because ââ¬Å"routâ⬠is not common in everyday speech. So, what is the difference? And which word should we use in any given instance? Rout (Lose Badly) The word ââ¬Å"routâ⬠is commonly associated with battles, as it means ââ¬Å"a disorderly retreat.â⬠Thus, if an army is defeated and forced to run, we say it was ââ¬Å"routedâ⬠(ââ¬Å"routâ⬠can be used as either a noun or a verb): During World War II, the French Army was routed at the Battle of Sedan. A more modern use of ââ¬Å"routâ⬠is to mean ââ¬Å"an overwhelming defeatâ⬠: In 1990, the 49ers routed the Broncos 55-10 in the Super Bowl. To the best of our knowledge, however, sporting routs rarely end in the losing team making a disorderly retreat from the field of play. Route (Go Places) If nothing else, youââ¬â¢ll probably know the word ââ¬Å"routeâ⬠from the US Highway System. This, in fact, is a big clue to the main meaning of ââ¬Å"route,â⬠which is ââ¬Å"a road or passage of travelâ⬠: If you ever plan to motor west Travel my way, take the highway that is best Get your kicks on Route Sixty-Six As well as major travel routes, the word ââ¬Å"routeâ⬠is used for any regular round of stops, such as a ââ¬Å"paper route.â⬠Furthermore, ââ¬Å"routeâ⬠can be used as a verb meaning ââ¬Å"direct somethingâ⬠: Because of the accident, traffic was routed away from the town center. In both cases, the essence of ââ¬Å"routeâ⬠is always to do with traveling or following a particular course. Rout or Route? In everyday life, youââ¬â¢re more likely to need ââ¬Å"routeâ⬠than ââ¬Å"rout.â⬠But if youââ¬â¢re discussing a battle or an overwhelming defeat in sport, you might need to use ââ¬Å"rout.â⬠Remember: Rout = An overwhelming defeat and/or disorderly retreat Route = A road or regular passage of travel Be careful when using the past tense with these words, though, as both are spelled routed.
Friday, February 14, 2020
HR Management Term Paper Example | Topics and Well Written Essays - 750 words
HR Management - Term Paper Example The human resource function has evolved with the changes in workforce attitude, technology, sociological factors, changing labor laws, and the changing organization environment (Mello, 2002). During the earlier ages, the HR problems related to absenteeism in the work place, poor working conditions, termination of production due to workers dissatisfaction, and other operational problems like lateness in reporting to work. Apple Corporation in its bid to lead in the technology sector has concentrated on engaging qualified and talented workforce with innovative skills in the development of its products. This has ensured that it introduces iPhones and Macintosh computers that are in high demand in the market. Moreover, strategic HR roles have seen the employeesââ¬â¢ participate in the formulation of policies that help steward the business into success. The company has assiduously rewarded its employees and recognized their talents while training their employeesââ¬â¢ skills through training. The economic cycle like the depression saw businesses experience dwindling profits and operational risks. This forced organizations to review their HR policies and functions in order to develop strategies that would ensure organizational survival and competitiveness (Boroughs, Palmer & Hunter, 2008). The government through the formulation of labor laws resulted in significant improvements in the working conditions and better employee pay. Currently, businesses are faced with completely new HR challenges that decelerate the realization of business goals and objectives. The current HR department has therefore been mandated with the duty of ensuring they attract and retain a workforce that has the potential of stewarding the businesses towards success. With the shift from administrative roles to strategic roles, HR managers apart from doing their administrative duties also play a center role in the execution of strategic functions. Strategies help businesses to reposition the mselves for competition and develop competencies for the changing market conditions (Mello, 2002). Therefore, the HR managers do several strategic functions. First, strategic managers assist in the formulation of strategic policies and principles that would help see the business develop competitive strengths against the competitors.HR managers take part in this process by ensuring that the engagement of employees and whole workforce reflects the necessary skills that would enable the business take measures that would ensure business succeed. In developing these policies, the HR managers will ensure that the recruited employees have the ability to develop strategies that leads to business success. Secondly, the HR department has the responsibility of developing strategic alliances that would enable the business enter into partnership with other businesses. Businesses form strategic alliances with other strategic partners with a bid to gain competitive strengths that would enable them maximize their returns and gain operational efficiency (Mello, 2002). Before entering into such partnerships and alliances, strategic managers have to ensure that such alliances are properly evaluated to determine their productivity. This can only be realized if the HR department carefully selects qualified staff with the
Saturday, February 1, 2020
Anything Essay Example | Topics and Well Written Essays - 500 words - 9
Anything - Essay Example This leads to accumulation of body fat. D. Enumerated Preview: This research will analyze the importance of exercise and healthy balanced meal in reducing the pressing issue of obesity. Obesity has been contributed by our current sedentary lifestyle and the over-consumption of energy- dense foods. 1. The role of culture in fitness and diet programs. There is a cultural pattern of being bigger and fat, and this is not a good trend. Most cultural norms discourage the consumption of a healthy meal. This encourages unhealthy meal consumption. 3. The nationââ¬â¢s public health strategy for addressing overweight and obesity issue. The government has come up with healthy eating strategies and action plans for school growing children. This is with the intention of curbing the issue of obesity and overweight. This strategy is organized into three goals which comprise of incorporating healthy meals, reducing the access and consumption of calorie-dense foods, and raising health awareness (Edelman, Mandle & Kudzma
Friday, January 24, 2020
Harold Brighouses Hobsons Choice Essay -- Brighouse Hobsons Choic
Harold Brighouse's "Hobson's Choice" In Act two, Alice tells Maggie ââ¬Å"I donââ¬â¢t know what youââ¬â¢re aiming at.â⬠She replies, ââ¬Å"The difference between us is I do, I always did.â⬠Explain the differences between Maggie and her sisters. ââ¬ËHobsonââ¬â¢s Choiceââ¬â¢ is set in Salford in 1880, at a time when women tended to occupy largely domestic roles. However, the leading character, Maggie Hobson, is a woman way ahead of her time. Unlike her sisters, she is a demanding and domineering character. She knows what she wants in life and is not afraid to strive for it. Alice and Vicky stand up to Hobson, their father, about small and trivial matters. After Hobson has complained about the bustles the girls wear, Alice says to her father: ââ¬Å"We shall continue to dress fashionably, Father.â⬠However, Alice and Vicky are very intimidated by Hobson and so when it comes to bigger and more important matters the talking is left to Maggie. Jim Heeler calls on Hobson to take him to the ââ¬ËMoonrakersââ¬â¢. This is a bar where he spends most of his time drinking a lot of alcohol. Whilst Jim is around, Hobson seeks some advice from him. He requires advice on how to manage the girls. In the end he decides to get Alice and Vicky ââ¬Ëwedââ¬â¢. After Hobson has told Alice and Vicky that he will be choosing husbands for them, the girls are extremely unhappy. They wish to choose their own partners: ââ¬Å"Can we not choose husbands for ourselves?â⬠But are told: ââ¬Å"Iââ¬â¢ve been telling you for the last five minutes, youââ¬â¢re not even fit to pick dresses for yourselvesâ⬠Because this is an important matter Maggie takes centre stage: ââ¬Å"If youââ¬â¢re dealing husbands around, donââ¬â¢t I get one?â⬠To which he replies: ââ¬Å"Well thatââ¬â¢s a good one, (laugh) you, with a husbandâ⬠Wi... ...w ââ¬Å"brother in lawâ⬠. The girls were not happy but still they were overruled by Maggieââ¬â¢s domineering character. To conclude, Maggie is different to her sisters in the way that she knows how to achieve the good things in life, she tries to bring out the good in every person. She makes her future good and she does it on her own. She stands up for what is right and for what she believes in. Maggie is not influenced at all by men and their opinions, she gains things by her own determination and will power. She is a person who values the fact that starting off small can lead to great success. Her sisters keep themselves to themselves and are too cowardly to stand up for themselves, therefore due to remaining passive characters, their future will be what the future makes it, not what they make for themselves as they do not intervene in order to make it better.
Thursday, January 16, 2020
New Religious Movements
When studied, compared, and scrutinized, every religion ââ¬â though said to be basically similar in that all believe and worship a god/gods ââ¬â is actually different from each other in many respects. Before tackling diversities however, it is better to start with similarities. Many people view all adherents of any religions share at the very least certain commonalities such as historical roots, practices/rituals, and doctrines. In other words, to be considered religious, one must be a follower of a certain form of ritual/practice prescribed by a founder or guru, a worshiper or believer of a god ââ¬â whatever or whoever that god might be. When looked at the surface, this might be true. However, looking closely and seeking out the nuances, one can find real diversities.For example, for a Jew and a Muslim, Christianity is a religion represented by Vatican and the pope as its representative. To the eyes of these two, no differences whatsoever are detected between a devout Ro man Catholic and a Protestant and a Mormon. Of course when investigated, marked differences come to the surface and the initial seemingly unified similarities are gone. Actually, differences are underscored every time there occurs along the way a deviation from the fundamentals of any religion. In the history of Christianity alone, schisms are either a deviation or a return to its roots (Adherents.com, 2007).Effects of Religious PluralismPost your response to this question: What effect do you think religious pluralism and the interfaith movement will have on the future of organized religion? Explain your answer.Religious pluralism and interfaith movement are recently advocated by proponents from different religions with certain political aims. For instance, during Holy Week in 1971, there were many demonstrations conducted by different religious groups to voice their antiwar protests. Professor Robert McAfee Brown of Stanford University was among those arrested for blocking the way to a draft board office in Berkeley, California. He said he chose to preach his sermon ââ¬Å"not in a church but on a pavement, not with words but with a deedâ⬠(Microsoft Encarta, 2007). Though there are certain benefits to it in terms of rights, there are also disadvantages and innumerable damages that may have paved the way for further confusion in the future.In what ways has learning about world religions influenced the way you think about religion? Why is it important to learn about other peoples' beliefs and attitudes? How will you utilize this information in the future?Knowledge of World religionsKnowledge of the different religions of the world and their adherentsââ¬â¢ beliefs and practices is necessary for a better understanding of different peoples and cultures. Religious tolerance means differently when taken in the light of this endeavor. The ability to understand world religions and appreciate people because of their different persuasions and beliefs mean a mor e empathic and compassionate stance towards any group, ethnic or religious assemblage. Those who differ from us will not be seen as enemies, which oftentimes have become a common experience (Adherents.com, 2007).Reference:Major Religions of the World Ranked by Number of Adherents, 2007. Retrieved March 11, 2008 ; http://www.adherents.com/Religions_By_Adherents.html;à Microsoft Encarta. 2007.
Wednesday, January 8, 2020
What Citizenship Means to Me Essay - 784 Words
August Jason Babasa Fey Engl 1301 Feb. 01 2013 What Citizenship Means To Me So what does citizenship means to me? Is it just a piece of paper that says you are a citizen of a country or does it mean something more in a deeper level. When I was just a little boy my mother always talks about that when we move to the United States we should apply for citizenship immediately. As I was growing up here in the United States I slowly understand what citizenship means to me. Being a citizen for me is fulfilling my obligations toward my country, Living a lifestyle that benefits myself and my community and having good sense of patriotism. Fulfilling my obligations toward my country is what citizenship means to me. Obligationsâ⬠¦show more contentâ⬠¦Showing respect for our surroundings is another way of being a good citizen. Cleaning our surroundings and not littering around the area is one way to show our respect for our surroundings. If we see garbage lying around the area we should immediately pick it up and throw in the proper waste container because it shows how we like the place that we live in to be clean. Being respectful towards our government also shows what good citizenship is. Not talking bad about our government and supporting our government on their decisions is one way to show that we are living a in a good community that respects our countries government. In closing living a lifestyle that benefits me and my community is what citizenship means to me. Showing a good sense of patriotism is what citizenship means to me. We can show our patriotism by showing our support in our military. Standing by what they are fighting for because our military have sacrificed many lives in defending our country. Showing them that we care about their well-being is one way of being a good citizen. We can also show a good sense of patriotism by showing respect on our countries flag. Standing up and saluting the flag during general assembly or singing our national anthem shows our deepest respect on our nationââ¬â¢s colors and those who have died defending them. Finally coming together as one for the greater good of everyone also shows a goodShow MoreRelatedThe Importance Of Citizenship In Antigone713 Words à |à 3 Pagesone of these countries would you still be bold enough to stand out because of what you believe? Would you be willing to sacrifice everything for your standards even if this means not being a good citizen? You might be surprised w hat people sacrifice for. In this essay you will hear more about my personal thoughts about what citizenship means to me, how it is shown as bad in the play, Antigone, and then more about citizenship and the responsibilities. Almost everybody in the world is a citizen to someRead MoreReflection Paper On The White Privilege848 Words à |à 4 Pagesto the citizenship. As Richard Wright said: ââ¬Å"There isnââ¬â¢t any Negro problem; there is only a white problem.â⬠Lots of people keep thinking that ââ¬Å"Americansâ⬠means white. After I read the reading assignment and watch the video several times, I start to understand that how does this situation happen in America. And learned several way to fix the racial problems. The class material give us some example of being American citizen. America have two types of citizenship, one is Birthright citizenship, to haveRead MoreCitizenship The Perspectives Of Political Theorists Aristotle And Hanna Pitkin1484 Words à |à 6 PagesTo tackle the term citizenship the perspectives of political theorists Aristotle and Hanna Pitkin come in handy in conceptualizing the term. Such honorable theorists have unique and yet intriguing views of citizenship, types of citizenship and the roles they play in societies. Although both theorists have different views and perspectives, they seem to come to similar conclusion when dissecting the difference between citizenship doing action and citizenship in the form of membership. Thus, the distinctionRead MoreA Citizen of the World: A Global Citizen Essay1053 Words à |à 5 Pagesbeen learning about the topic ââ¬Ëglobal citizenshipââ¬â¢. A broad based topic that had no exact definition tied to it. In and out of class we have been asked to read a number of articles and book passages to help us form a definition of what exactly the term global citizenship means to us. So exactly what is global citizenship? Global citizenship is not simply defined as one thing; it is a large array of various definitions. The basis of it is global citizenship is being a responsible and active memberRead MoreGlobal Education And Global Citizenship984 Words à |à 4 PagesGlobal Education and Global Citizenship Earth, countries, and communities are all composed of individuals, these individuals are formed based off of their living and learning environment. The term ââ¬Ëglobal citizenshipââ¬â¢ can seem confusing and goes misunderstood at times. It is important to keep in mind that this term is a bit vague and can have multiple meanings to different people. To sum up the overall meaning of this term, is an individual that realizes and accept the world and all itââ¬â¢s diversityRead MoreImportance Of A Global Citizen1327 Words à |à 6 Pages Importance of developing global citizenship 10/15/2017 Jerrid Lee Gen449: General Education Capstone Instructor: Meresa Stacy Importance of developing global citizenship Global citizenship has become something that you see in just about every country that you visit in today s world. If you are in America, you will see Americans, Europeans, Muslims, etc. walking around. This has become the new normal. Even in other countries, if you visit, you will see people from all over theRead MoreTranslation Table 11549 Words à |à 7 Pagestable as a tool to explain to me why the number increases exponentially when I had asked them how they calculate the amount of money I need to pay. I got this table and the way to calculate the number some time in December 2014. And, it was long after the fact that Iââ¬â¢ve been paying them -a thousand here, two thousands there- for years every single month since 2011. However, I first started keeping the record of payment in July 2014. When they requested more money from me in November 2014, I insistedRead MoreCitizen, By Claudia Rankine Essay1294 Words à |à 6 Pagesof gaining the title of becoming a citizen within a country. But often times people do not think of ââ¬Å"citizenâ⬠or ââ¬Å"citizenshipâ⬠to be connected to race. In Claudia Rankineââ¬â¢s book ââ¬Å"Citizenâ⬠, she takes time to discuss and display specific moments that have happened in the lives of African Americans who live in the United States. By doing so, she is investigating in depth of what it means to be a Black American ââ¬Å"citizenâ⬠today in society. These stories, although reflecting upon minuscule moments, paintRead MoreThe Solitary Stroller And The City By Ian Borden1697 Words à |à 7 PagesCitizen of the World The citizenship is the natural right to belong to a certain culture or country. Whether it be metaphorical or not, citizenship can mean a sense of belonging to anyone within its guidelines. Citizenship, while it does have a legal application, doesnââ¬â¢t mean that it has to a physical boundary. Communities can be viewed as citizenships within citizenships. In ââ¬Å"The Solitary Stroller and the Cityâ⬠Solnit talks about experiencing a lack of community and citizenship while in a large cityRead MoreUndocumented Immigrants Should Not Be Illegal1082 Words à |à 5 Pagesimmigration reform was passed. It claimed that US create a tough but fair path to citizenship for unauthorized immigrants currently living in the US. Since then the problem ââ¬Å"Should Undocumented Immigrants Have a Path to Citizenship?â⬠has been risen to the stage of politics. Many governor and citizen think there should have some path for undocumented immigrants to gain citizenship. By helping the u ndocumented immigrant to get citizenship could boost the United Stated economy development, bring in more talent
Subscribe to:
Posts (Atom)